ILM - creating new policy throw error "invalid_index_name_exception"

Hi,

I am trying to create a policy in ILM to delete indices which are older than 90 days.
My elasticsearch version is 6.6.1.
When I run the following query in dev tools of kibana:

PUT _ilm/policy/retention_policy
{
  "policy": {
    "phases": {
      "warm": {
        "min_age": "1d",
        "actions": {
          "allocate": {
            "number_of_replicas": 1
          }
        }
      },
      "delete": {
        "min_age": "90d",
        "actions": {
          "delete": {}
        }
      }
    }
  }
}

I get this error:

 {
  "error": {
    "root_cause": [
      {
        "type": "invalid_index_name_exception",
        "reason": "Invalid index name [_ilm], must not start with '_', '-', or '+'",
        "index_uuid": "_na_",
        "index": "_ilm"
      }
    ],
    "type": "invalid_index_name_exception",
    "reason": "Invalid index name [_ilm], must not start with '_', '-', or '+'",
    "index_uuid": "_na_",
    "index": "_ilm"
  },
  "status": 400
}

What is the mistake that I'm doing here? Because the examples I had seen did use "_ilm" as the name.

Appreciate the help

Regards
Hameed

It looks like you may not be using x-pack (which is the plugin with ILM), I would check the output of GET /_xpack and see whether x-pack is installed.

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