我在弹性搜索中有一些索引,其命名格式为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