I have the many of my logs indexed in logstash-Year-Week format. That is if i want to delete indices older than a few weeks, how can I achieve that in elasticsearch. Is ther
you can use curl
curl -X DELETE http://localhost:9200/filebeat-$(date +"%Y.%m.%d" -d "last Month")
this must to add this command to xxx.sh, and you can create crontab. crontab -e
00 00 * * * /etc/elasticsearch/xxx.sh
this cron will running everyday at 12pm and it will remove old log.