Search code examples
elasticsearchelasticsearch-2.0elasticsearch-curator

Elasticsearch Curator : Does not display indices as per timestring


I am trying to explore elasticsearch curator using CLI

https://www.elastic.co/guide/en/elasticsearch/client/curator/current/index.html

i ran the command

curator --host hostName --port 9200 show indices --prefix ab-

and it gives me

ab-2016-05-04
ab-2016-05-05
ab-2016-05-07
ab-2016-05-11

which is perfect. Now i just want to see the indices that are older than 14 days. so i tried

curator --host hostName --port 9200 show indices --prefix ab- --older-than 14 --time-unit days --timestring 'cl-%%Y-%%m-%%d'

and it gives me

No indices matched provided args:

i think i am not specifying the timestring correctly but i can figure out why.

i tried

--timestring %Y%m%d
--timestring %Y-%m-%d

but they dont work as well. how can i properly provide the timestring?

note that, if i do

curator --host hostName --port 9200 show indices --prefix ab- --older-than 1 --time-unit days --timestring %Y-%m-%d

then i get

ab-2016-05-04
ab-2016-05-05
ab-2016-05-07
ab-2016-05-11

that does not make sense. clearly, all of these indices are older than 14 days as well! as to day is 05/17

Update

Looking at

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.

so again, why do i not see the indices that were created more than 14 days ago?


Solution

  • Because your indices are not older than 14 days. On 05/17 - 14 days is 05/03 which is 14 days old. You need an index like ab-2016-05-02to match your 14 days search. You can try it by increasing the days one by one.