#  Index not moving to delete phase

**URL:** <https://discuss.elastic.co/t/index-not-moving-to-delete-phase/333026>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [May 10, 2023, 6:37am UTC](https://discuss.elastic.co/t/index-not-moving-to-delete-phase/333026 "2023-05-10T06:37:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tirelibirefe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tirelibirefe/32/71511_2.png) [@tirelibirefe](https://discuss.elastic.co/u/tirelibirefe)\
**Post date:** [May 10, 2023, 6:37am UTC](https://discuss.elastic.co/t/index-not-moving-to-delete-phase/333026/1 "2023-05-10T06:37:32Z")

</div>

Hello,  
I have Elasticsearch 8 on K8s. Fluentbit sends logs to ES8. Everyday new indexes are created based on date; likes this:  
backend-app-2023.05.09  
backend-app-2023.05.10  
backend-app-2023.05.11  
...  
I would like enable ILM on these indexes. Regarding to the [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/getting-started-index-lifecycle-management.html#ilm-gs-alias-apply-policy), I prepared following configuration:

```auto
PUT _ilm/policy/delete-policy
{
  "policy": {
    "phases": {
      "hot": {
        "min_age": "30s",
        "actions": {
          "set_priority": {
            "priority": 100
          },
          "rollover": {
            "max_primary_shard_size": "1MB"
          }
        }
      },
      "delete": {
        "min_age": "3m",
        "actions": {
          "delete": {
            "delete_searchable_snapshot": true
          }
        }
      }
    }
  }
}

PUT _index_template/short-live
{
  "index_patterns": [
    "backend-*"
  ],
  "template": {
    "settings": {
      "number_of_shards": 1,
      "number_of_replicas": 0,
      "index.lifecycle.name": "delete-policy",
      "index.lifecycle.rollover_alias": "short-live"
    },
    "aliases" : {
        "short-live" : {}
    }
  },
  "priority": 500
}

PUT backend-000001
{
  "aliases": {
    "short-live": {
      "is_write_index": true
    }
  }
}

```

My configuration doesn't work. Nothing is deleted. As far as I understood, the index not moving to delete phase. The existing index size keeps increase.

Could you please advise?

Thanks & Regards

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 11, 2023, 12:46am UTC](https://discuss.elastic.co/t/index-not-moving-to-delete-phase/333026/2 "2023-05-11T00:46:41Z")

</div>

> [@tirelibirefe](#):
>
> Everyday new indexes are created based on date;

You don't want this, you need to change fluentbit to write to `short-live` and let ILM create the underlying indices.

---

<div class="post-metadata">

**Author:** ![tirelibirefe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tirelibirefe/32/71511_2.png) [@tirelibirefe](https://discuss.elastic.co/u/tirelibirefe)\
**Post date:** [May 11, 2023, 8:53am UTC](https://discuss.elastic.co/t/index-not-moving-to-delete-phase/333026/3 "2023-05-11T08:53:02Z")

</div>

if I use "short-live" as index name, the alias "short-live" cannot be used in index-template.

---

<div class="post-metadata">

**Author:** ![tirelibirefe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tirelibirefe/32/71511_2.png) [@tirelibirefe](https://discuss.elastic.co/u/tirelibirefe)\
**Post date:** [May 11, 2023, 11:06am UTC](https://discuss.elastic.co/t/index-not-moving-to-delete-phase/333026/4 "2023-05-11T11:06:21Z")

</div>

Regarding to your advise, If I write fluent-bit logs to "short-live", ES doesn't let me create backend-000001 index:

```auto
{
  "error": {
    "root_cause": [
      {
        "type": "invalid_alias_name_exception",
        "reason": "Invalid alias name [short-live]: an index or data stream exists with the same name as the alias"
      }
    ],
    "type": "invalid_alias_name_exception",
    "reason": "Invalid alias name [short-live]: an index or data stream exists with the same name as the alias"
  },
  "status": 400
}

```

---

<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:** [June 8, 2023, 11:06am UTC](https://discuss.elastic.co/t/index-not-moving-to-delete-phase/333026/5 "2023-06-08T11:06:25Z")

</div>

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