删除与特定模式匹配的ElasticSearch索引

时间:2016-03-17 00:12:18

标签: elasticsearch elasticsearch-curator

如何使用ElasticSearch curator删除与特定模式匹配的旧索引。像这样使用curator将删除所有索引而不是匹配模式的索引:

curator --host <ip address> delete indices --time-unit days --older-than 45 --timestring '%Y%m%d'

假设有人想要删除45天前与sample_index_*匹配的索引,那该怎么办呢?

1 个答案:

答案 0 :(得分:1)

试试这个:

curator --host delete indices --time-unit days --older-than 45 --timestring'%Y%m%d'--prefix sample _

除了前缀选项,您还可以使用后缀和正则表达式

相关问题