First of all, create a configuration file. This file specifies which indexes to delete.
An example of the content of such a file can be explained as below:
Delete indices older than 30 days (based on index name), for logstash-
prefixed indices. Ignore the error if the filter does not result in an
actionable list of indices (ignore_empty_list) and exit cleanly.
- filtertype: pattern
- filtertype: age
In order for the action to be performed cyclically, you must add the command to crontab.
* 1 * * * /usr/bin/curator --config /opt/elasticsearch-curator/.curator/curator.yml /opt/elasticsearch-curator/actions/delete.yml > /dev/null 2>&1
Before running the command, test the curator's operation by adding a flag: