I got sick of having to trim my Logstash indices in Elasticsearch manually, so I created a PowerShell script and set it as a scheduled task. By default it keeps the last 60 days.
1
2
3
4
5
6
7
8
9
10
11
12
13
#Replace with the URL of your Elasticsearch instance
$url = "http://elasticsearch:9200/"
#Replace with how many days you want to keep, minus one (below means 60)