Script to cleanup Elasticsearch inidices automatically
This script is able to delete indicies older than 21 days or, when there is lots of data comming in at once, delete the oldest indices when free disk space is lower than 25 percent.
- Place this script on the same server as where your Elasticsearch Data is located
- do a "chmod +x" on this file
- if you want, you can schedule this as a job.
- my crontab -e looks like this " 0 23 * * * /etc/scripts/cleanup.sh"