gpt4 book ai didi

elasticsearch - Elasticsearch Curator:不按时间字符串显示索引

转载 作者:行者123 更新时间:2023-12-03 01:01:07 26 4
gpt4 key购买 nike

我正在尝试使用CLI探索Elasticsearch策展人

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天以上创建的索引?

最佳答案

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

关于elasticsearch - Elasticsearch Curator:不按时间字符串显示索引,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37279676/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com