We are creating daily indices and have a need of automatically closing them when they get older than 3 months. I have the following in my Curator action file:
14:
action: close
description: >-
Close indices older than 3 months that are allocated to the archive-node
options:
delete_aliases: False
disable_action: False
ignore_empty_list: False
filters:
- filtertype: age
source: name
direction: older
timestring: '%Y-%m-%d'
unit: months
unit_count: 3
- filtertype: allocated
key: box_type
value: archive
This is the name of an example index that is not being closed:
2019-06-23 20:18:42,719 INFO Preparing Action ID: 14, "close"
2019-06-23 20:18:42,722 INFO Trying Action ID: 14, "close": Close indices older than 3 months that are allocated to the archive-node
2019-06-23 20:19:13,755 INFO Skipping action "close" due to empty list: <class 'curator.exceptions.NoIndices'>
2019-06-23 20:19:13,755 INFO Action ID: 14, "close" completed.
2019-06-23 20:19:13,755 INFO Job completed.
You have not define any pattern in your action file. So you should define the pattern and your action file will be look like below:
actions:
1:
action: close
description: >-
Close indices older than 30 days (based on index name), for logstash-
prefixed indices.
options:
delete_aliases: False
timeout_override:
continue_if_exception: False
disable_action: True
filters:
- filtertype: pattern
kind: prefix
value: logstash-azurestack-
exclude:
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: 90
exclude:
Please try above action file. If you face any issue let me know.
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.