Script – Remove Indices from x Days Ago


We’re looking to develop a rest script that we can run to
remove any indices before x amount of days, this is required for log retention policies.

We run logstash from Ubuntu servers and can handle the bash scripts
but wanting assistance creating some restful queries to perform this.

Indices are created as “[logstash-]YYYY.MM.DD”

Cluster name: elasticsearch


You can use Elasticsearch Curator, a python script designed exactly for this :slight_smile:

1 Like

Thanks I'll give that a go.

Thanks, this worked for me and was able to script it into a
bash file.

Can curator be used to retrieve documents or just indices?

Anyone recomend a method for my last question? Thanks.