# Define different ILM policyes for each elasticAgent integration

**URL:** <https://discuss.elastic.co/t/define-different-ilm-policyes-for-each-elasticagent-integration/369327>\
**Category:** Elastic Agent\
**Tags:** ilm-index-lifecycle-management\
**Created:** [October 24, 2024, 7:06am UTC](https://discuss.elastic.co/t/define-different-ilm-policyes-for-each-elasticagent-integration/369327 "2024-10-24T07:06:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fabry\_00](https://avatars.discourse-cdn.com/v4/letter/f/ea5d25/32.png) [@fabry\_00](https://discuss.elastic.co/u/fabry_00)\
**Post date:** [October 24, 2024, 7:06am UTC](https://discuss.elastic.co/t/define-different-ilm-policyes-for-each-elasticagent-integration/369327/1 "2024-10-24T07:06:32Z")

</div>

I have an ELK cluster with a fleetServer and some elasticAgents. As for now, I've added 2 prometheus integration to scrape the metrics from 2 different applications:

- The namespace of both prometheus package\_polices is: XXX
- The data\_stream.dataset for the prometheus package\_policy that scrapes the metrics for the application A is "prometheus.collector.appa"
- The data\_stream.dataset for the prometheus package\_policy that scrapes the metrics for the application B is "prometheus.collector.appb"

I can see the metrics in the following data streams:

- metrics-prometheus.collector.appa
- metrics-prometheus.collector.appb

The question is: I need to have a different ILM policy for appa and appb (the default metrics policy is not good for us). How can I define those ilm policies and assign it to the 2 different datastreams?

I tried this: [Tutorial: Customize built-in ILM policies | Elasticsearch Guide [8.15] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/example-using-index-lifecycle-policy.html) but it dind't help (unless I did something wrong)

Thank you

---

<div class="post-metadata">

**Author:** ![fabry\_00](https://avatars.discourse-cdn.com/v4/letter/f/ea5d25/32.png) [@fabry\_00](https://discuss.elastic.co/u/fabry_00)\
**Post date:** [October 24, 2024, 11:49am UTC](https://discuss.elastic.co/t/define-different-ilm-policyes-for-each-elasticagent-integration/369327/2 "2024-10-24T11:49:15Z")

</div>

Added #ilm-index-lifecycle-management
