# Best way to attach delete index via ilm

**URL:** <https://discuss.elastic.co/t/best-way-to-attach-delete-index-via-ilm/216078>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [January 22, 2020, 2:34pm UTC](https://discuss.elastic.co/t/best-way-to-attach-delete-index-via-ilm/216078 "2020-01-22T14:34:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jathin](https://avatars.discourse-cdn.com/v4/letter/j/ea666f/32.png) [@Jathin](https://discuss.elastic.co/u/Jathin)\
**Post date:** [January 22, 2020, 2:34pm UTC](https://discuss.elastic.co/t/best-way-to-attach-delete-index-via-ilm/216078/1 "2020-01-22T14:34:45Z")

</div>

It seems each new filebeat version creates its own mapping template and ilm policy. i had to manually update ilm policy to add delete phase. but for each new version a new ilm policy is created with default sections (without delete phase) and then has to be updated manually. is there a more easier approach for this ?

---

<div class="post-metadata">

**Author:** ![Mario\_Castro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mario_castro/32/35107_2.png) [@Mario\_Castro](https://discuss.elastic.co/u/Mario_Castro)\
**Post date:** [January 23, 2020, 6:36pm UTC](https://discuss.elastic.co/t/best-way-to-attach-delete-index-via-ilm/216078/2 "2020-01-23T18:36:14Z")

</div>

Hi @Jathin 🙂

I'm not an expert in ILM but when you usually apply a Policy to an **index template** which should look like `filebeat-*` so no matter which version you are using, it will cover indices starting with `filebeat-*`. Some extra info: [https://www.elastic.co/guide/en/elasticsearch/reference/current/applying-policy-to-template.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/applying-policy-to-template.html)

I hope this helps

---

<div class="post-metadata">

**Author:** ![Jathin](https://avatars.discourse-cdn.com/v4/letter/j/ea666f/32.png) [@Jathin](https://discuss.elastic.co/u/Jathin)\
**Post date:** [January 23, 2020, 6:40pm UTC](https://discuss.elastic.co/t/best-way-to-attach-delete-index-via-ilm/216078/3 "2020-01-23T18:40:03Z")

</div>

But it seems filebeat create templates for each version and they map to a ilm policy with version in name and that ilm policy does not have delete phase.. also you can just have one policy per index.

---

<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:** [February 20, 2020, 6:50pm UTC](https://discuss.elastic.co/t/best-way-to-attach-delete-index-via-ilm/216078/4 "2020-02-20T18:50:30Z")

</div>

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