自动清理6月之前的数据
- fromday=$(date +'%FT%T+0800' -d '6 months ago')
- today=$(date +'%FT%T+0800')
- index=
- host=
- curl -X POST "http://${host}:9200/${index}/_delete_by_query?pretty=true" \
- -d "{\"query\":{\"range\": {\"date\":{\"lt\":\"${fromday}\"}}}}" --header 'content-type:application/json'
- echo 'done'
-