【发布时间】:2016-05-18 07:01:32
【问题描述】:
我正在尝试使用 CLI 探索 elasticsearch curator
https://www.elastic.co/guide/en/elasticsearch/client/curator/current/index.html
我运行了命令
curator --host hostName --port 9200 show indices --prefix ab-
它给了我
ab-2016-05-04
ab-2016-05-05
ab-2016-05-07
ab-2016-05-11
这是完美的。现在我只想查看超过 14 天的索引。所以我尝试了
curator --host hostName --port 9200 show indices --prefix ab- --older-than 14 --time-unit days --timestring 'cl-%%Y-%%m-%%d'
它给了我
No indices matched provided args:
我认为我没有正确指定时间字符串,但我可以找出原因。
我试过了
--timestring %Y%m%d
--timestring %Y-%m-%d
但它们也不能正常工作。如何正确提供时间字符串?
请注意,如果我这样做了
curator --host hostName --port 9200 show indices --prefix ab- --older-than 1 --time-unit days --timestring %Y-%m-%d
然后我得到
ab-2016-05-04
ab-2016-05-05
ab-2016-05-07
ab-2016-05-11
这没有意义。显然,所有这些指数也都超过 14 天!至于今天是 05/17
更新
看着
https://www.elastic.co/guide/en/elasticsearch/client/curator/current/older-than.html
The value provided indicates a given number of time-units ago to use as a reference point. All indices "older than" that point will be included.
那么,为什么我看不到超过 14 天前创建的索引?
【问题讨论】:
标签: elasticsearch elasticsearch-2.0 elasticsearch-curator