There are several ways to approach this, but it matters what you actually want in the snapshots.
Do you only want to snapshot indices with a year-month-day pattern in the name? Or are there some indices you want to snapshot that don't have that pattern? Because you have source: creation_date, Curator will ignore timestring: '%Y-%m-%d'. That line won't matter in your age filter.
If all of the indices you wanted to snapshot have a year-month-day pattern, you could simply exclude the prefix filter, and change to source: name.
filters:
- filtertype: age
source: name
timestring: '%Y-%m-%d'
direction: older
unit: days
unit_count: 5
You could also filter by timestring pattern but not by the date indicated by the timestring in the index name (and still use the creation_date) this way:
filters:
- filtertype: pattern
kind: timestring
value: '%Y-%m-%d'
- filtertype: age
source: creation_date
direction: older
unit: days
unit_count: 5
This filter block will only act on indices with a year-month-day pattern, and only those with a creation_date older than 5 days ago.
If you need to match certain patterns, you could also use a regex pattern kind:
filters:
- filtertype: pattern
kind: regex
value: '^(myindexa-|myindexb-|myindexc-|myindexn-).*$'
- filtertype: age
source: creation_date
direction: older
unit: days
unit_count: 5
This filter block will only act on indices that begin with myindexa-, myindexb-, myindexc-, or myindexn-, and have a creation_date older than 5 days.
Hopefully this gives you some ideas. If you have more questions, feel free to ask!
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.