【发布时间】:2016-04-22 11:04:03
【问题描述】:
我在 elasticsearch 中有一些索引,其命名格式为 elk-console-YYYY-MM-DDtHH。例如:-
elk-console-2016-03-30t14
elk-console-2016-03-30t16
我想使用curator 删除所有超过 1 小时的索引。所以我尝试执行以下命令:-
curator --host localhost delete indices --older-than 1 --time-unit hours --timestring '%Y-%m-%dt%H'
但它给了我以下输出:-
2016-04-22 16:27:36,049 INFO Job starting: delete indices
2016-04-22 16:27:36,058 INFO Pruning Kibana-related indices to prevent accidental deletion.
2016-04-22 16:27:36,058 WARNING No indices matched provided args: {'regex': None, 'index': (), 'suffix': None, 'newer_than': None, 'closed_only': False, 'prefix': None, 'time_unit': 'hours', 'timestring': u'%Y-%m-%dt%H', 'exclude': (), 'older_than': 1, 'all_indices': False}
No indices matched provided args: {'regex': None, 'index': (), 'suffix': None, 'newer_than': None, 'closed_only': False, 'prefix': None, 'time_unit': 'hours', 'timestring': u'%Y-%m-%dt%H', 'exclude': (), 'older_than': 1, 'all_indices': False}
我也尝试执行以下命令:-
curator --host localhost delete indices --older-than 1 --time-unit hours --timestring '%Y-%m-%dt%H' --prefix elk-console-
但仍然出现以下错误:-
2016-04-22 16:48:43,848 INFO Job starting: delete indices
2016-04-22 16:48:43,856 INFO Pruning Kibana-related indices to prevent accidental deletion.
2016-04-22 16:48:43,856 WARNING No indices matched provided args: {'regex': None, 'index': (), 'suffix': None, 'newer_than': None, 'closed_only': False, 'prefix': u'elk-console-', 'time_unit': 'hours', 'timestring': u'%Y-%m-%dt%H', 'exclude': (), 'older_than': 1, 'all_indices': False}
No indices matched provided args: {'regex': None, 'index': (), 'suffix': None, 'newer_than': None, 'closed_only': False, 'prefix': u'elk-console-', 'time_unit': 'hours', 'timestring': u'%Y-%m-%dt%H', 'exclude': (), 'older_than': 1, 'all_indices': False}
有人可以帮我在我的情况下使用什么timestring 格式吗?
环境:-
- 策展人3.5.1
- 弹性搜索 - 2.3.1
【问题讨论】:
标签: elasticsearch elasticsearch-curator