I want to delete the elasticsearch indices older than 7 days. So I have installed curator 4.2 as my elasticsearch version is 5.0.0 (curator version before 4.x are not compatible with elasticsearch v5)
we need to create configuration file and action file to make this work. I have created my config and action file in root directory
My configuration file curator.yml is
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
client:
hosts:
- 127.0.0.1
port: 9200
url_prefix:
use_ssl: False
certificate:
client_cert:
client_key:
aws_key:
aws_secret_key:
aws_region:
ssl_no_validate: False
http_auth:
timeout: 30
master_only: False
logging:
loglevel: INFO
logfile:
logformat: default
blacklist: ['elasticsearch', 'urllib3']
My action file curatorAction.yml is
actions:
1:
action: delete_indices
description: >-
Delete indices older than 45 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.
options:
ignore_empty_list: True
timeout_override:
continue_if_exception: False
disable_action: True
filters:
- filtertype: pattern
kind: prefix
value: logstash-
exclude:
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: 7
exclude:
I am running the curator with the CLI as
curator --config curator.yml --dry-run curatorAction.yml
but I am getting this error. I can't find anything regarding this anywhere. Any help will be appreciated.
2017-02-15 17:52:02,991 ERROR Schema error: extra keys not allowed @ data[1]
Traceback (most recent call last):
File "/usr/local/bin/curator", line 11, in <module>
load_entry_point('elasticsearch-curator==4.2.6', 'console_scripts', 'curator')()
File "/usr/local/lib/python2.7/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/curator/cli.py", line 126, in cli
action_dict = validate_actions(action_config)
File "/usr/local/lib/python2.7/site-packages/curator/utils.py", line 1085, in validate_actions
root = SchemaCheck(data, actions.root(), 'Actions File', 'root').result()
File "/usr/local/lib/python2.7/site-packages/curator/validators/schemacheck.py", line 68, in result
self.test_what, self.location, self.badvalue, self.error)
curator.exceptions.ConfigurationError: Configuration: Actions File: Location: root: Bad Value: "{'action': 'delete_indices', 'description': 'Delete selected indices', 'filters': [{'exclude': None, 'kind': 'prefix', 'filtertype': 'pattern', 'value': 'logstash-'}, {'source': 'name', 'direction': 'older', 'unit_count': 30, 'timestring': '%Y.%m.%d', 'exclude': None, 'filtertype': 'age', 'unit': 'days'}], 'options': {'continue_if_exception': False, 'timeout_override': None, 'disable_action': False}}", extra keys not allowed @ data[1]. Check configuration file.