How to name dated Index for ILM with Roll over

I have an ILM policy with roll over functionality and below is my Index name which consists of year-month-date and roll over series.(YYYY.MM.DD-000001)

    'PUT test-2020.07.26-000001
    {
      "aliases": {
        "test_alias": {
          "is_write_index": true
        }
      }
    }'

I have bootstrapped the ILM with write alias and currently data is pushing into index(test-2020.07.26-000001)

below are my doubts:

  1. if roll over condition is met on July 31st, will my index roll over to "test-2020.07.31-000002" or "test-2020.07.26-000002"

  2. will the data of 8th month will be inserted into "test-2020.08.01-000001" Index ?

  3. is my index naming convention correct? if not how can I reflect year,month,date changes in new rolled indexes?

Thanks for the help.

You need to use the date math and escape it correctly, so for instance:

PUT /%3Ctest-%7Bnow%2Fd%7D-000001%3E
{
  "aliases": {
    "test_alias": {
      "is_write_index": true
    }
  }
}

Which is essentially sending <test-{now/d}-000001> as the index name

  • if roll over condition is met on July 31st, will my index roll over to "test-2020.07.31-000002" or "test-2020.07.26-000002"

The index would be "test-2020.07.31-000002" (once set up properly)

  • will the data of 8th month will be inserted into "test-2020.08.01-000001" Index ?

It won't be -000001, as the number of the index at the end always increases when the index is rolled over.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.