# Create ILM Policy from Logstash when does not exist

**URL:** <https://discuss.elastic.co/t/create-ilm-policy-from-logstash-when-does-not-exist/253798>\
**Category:** Logstash\
**Tags:** ilm-index-lifecycle-management\
**Created:** [October 30, 2020, 10:47am UTC](https://discuss.elastic.co/t/create-ilm-policy-from-logstash-when-does-not-exist/253798 "2020-10-30T10:47:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kosodrom](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kosodrom/32/99278_2.png) [@Kosodrom](https://discuss.elastic.co/u/Kosodrom)\
**Post date:** [October 30, 2020, 10:47am UTC](https://discuss.elastic.co/t/create-ilm-policy-from-logstash-when-does-not-exist/253798/1 "2020-10-30T10:47:48Z")

</div>

Hi there,

I was wondering if it is possible to create an ilm policy automatically in a logstash pipeline. My use case:

I collect logs from an kubernetes cluster and create indices based on the applications for example:

`filebeat-%{[kubernetes][labels][app]}`

Since I never know (and I don't want to know) if a new application was deployed to kubernetes I would like to be able to automatically create a new ILM policy so the developers can adjust it for their logs when they want to. Otherwise I always need to create a policy first.

Is it possible?

Thanks

---

<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:** [November 27, 2020, 10:48am UTC](https://discuss.elastic.co/t/create-ilm-policy-from-logstash-when-does-not-exist/253798/2 "2020-11-27T10:48:03Z")

</div>

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