# How to specify ILM policies in Elastic agent policy config?

**URL:** <https://discuss.elastic.co/t/how-to-specify-ilm-policies-in-elastic-agent-policy-config/341296>\
**Category:** Elastic Agent\
**Tags:** fleet\
**Created:** [August 21, 2023, 7:43pm UTC](https://discuss.elastic.co/t/how-to-specify-ilm-policies-in-elastic-agent-policy-config/341296 "2023-08-21T19:43:06Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Craig\_Rodrigues](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/craig_rodrigues/32/121875_2.png) [@Craig\_Rodrigues](https://discuss.elastic.co/u/Craig_Rodrigues)\
**Post date:** [August 21, 2023, 10:19pm UTC](https://discuss.elastic.co/t/how-to-specify-ilm-policies-in-elastic-agent-policy-config/341296/3 "2023-08-21T22:19:04Z")

</div>

Thank you @leandrojmp . Your response is very concise and accurate.

I have a related post about elastic agent datasets: [Performance impact of setting 'namespace' in Elastic agent policy config](https://discuss.elastic.co/t/performance-impact-of-setting-namespace-in-elastic-agent-policy-config/341294)

If I have 2000 Elastic agents, 20 agent policies, does that mean that:

1. Look up the Elastic agents that I want to have a customized data retention policy
2. For each Elastic agent, I need to look up the datastream used by that agent going to kbn:/app/fleet/data-streams
3. For each datastream that I want to have a customized ILM, I would need to use custom ILM policies according to the [documentation](https://www.elastic.co/guide/en/fleet/current/data-streams-ilm-tutorial.html#data-streams-ilm-tutorial)

Is my understanding correct?

---

_[View the full topic](https://discuss.elastic.co/t/how-to-specify-ilm-policies-in-elastic-agent-policy-config/341296)._
