# Logstash configure custom ilm policy per elasticsearch datastream output

**URL:** <https://discuss.elastic.co/t/logstash-configure-custom-ilm-policy-per-elasticsearch-datastream-output/279757>\
**Category:** Logstash\
**Created:** [July 27, 2021, 5:20pm UTC](https://discuss.elastic.co/t/logstash-configure-custom-ilm-policy-per-elasticsearch-datastream-output/279757 "2021-07-27T17:20:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anupshrestha](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anupshrestha/32/78726_2.png) [@anupshrestha](https://discuss.elastic.co/u/anupshrestha)\
**Post date:** [July 27, 2021, 5:20pm UTC](https://discuss.elastic.co/t/logstash-configure-custom-ilm-policy-per-elasticsearch-datastream-output/279757/1 "2021-07-27T17:20:11Z")

</div>

Is there a way to specify a custom ilm policy when using datastream with elasticsearch output in logstash.

The goal here is to have separate data retention period per datastream in elasticsearch. Any help or feedback is much appreciated.

ES/Logstash Version: 7.13.2

---

<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:** [August 24, 2021, 5:20pm UTC](https://discuss.elastic.co/t/logstash-configure-custom-ilm-policy-per-elasticsearch-datastream-output/279757/2 "2021-08-24T17:20:50Z")

</div>

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