【问题标题】:Elasticsearch Curator : Does not display indices as per timestringElasticsearch Curator:不按时间字符串显示索引
【发布时间】: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


    【解决方案1】:

    因为您的索引不超过 14 天。 05/17 - 14 天是 05/03,即 14 天。您需要像 ab-2016-05-02 这样的索引来匹配您的 14 天搜索。您可以通过将天数逐个增加来尝试。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-11-24
      • 2017-01-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多