# ILM - creating new policy throw error "invalid\_index\_name\_exception"

**URL:** <https://discuss.elastic.co/t/ilm-creating-new-policy-throw-error-invalid-index-name-exception/244517>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [August 11, 2020, 9:16am UTC](https://discuss.elastic.co/t/ilm-creating-new-policy-throw-error-invalid-index-name-exception/244517 "2020-08-11T09:16:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abdul\_Hameed](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abdul_hameed/32/46158_2.png) [@Abdul\_Hameed](https://discuss.elastic.co/u/Abdul_Hameed)\
**Post date:** [August 11, 2020, 9:16am UTC](https://discuss.elastic.co/t/ilm-creating-new-policy-throw-error-invalid-index-name-exception/244517/1 "2020-08-11T09:16:59Z")

</div>

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:

```auto
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:

```auto
 {
  "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

---

<div class="post-metadata">

**Author:** ![dakrone](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dakrone/32/23351_2.png) [@dakrone](https://discuss.elastic.co/u/dakrone)\
**Post date:** [August 13, 2020, 6:52pm UTC](https://discuss.elastic.co/t/ilm-creating-new-policy-throw-error-invalid-index-name-exception/244517/2 "2020-08-13T18:52:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 10, 2020, 6:52pm UTC](https://discuss.elastic.co/t/ilm-creating-new-policy-throw-error-invalid-index-name-exception/244517/3 "2020-09-10T18:52:34Z")

</div>

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