# Elastic Agent, specifying number of shards and ILM policy

**URL:** <https://discuss.elastic.co/t/elastic-agent-specifying-number-of-shards-and-ilm-policy/326945>\
**Category:** Elastic Agent\
**Tags:** filebeat\
**Created:** [March 3, 2023, 2:05pm UTC](https://discuss.elastic.co/t/elastic-agent-specifying-number-of-shards-and-ilm-policy/326945 "2023-03-03T14:05:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mirko\_Katunar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mirko_katunar/32/118017_2.png) [@Mirko\_Katunar](https://discuss.elastic.co/u/Mirko_Katunar)\
**Post date:** [March 3, 2023, 2:05pm UTC](https://discuss.elastic.co/t/elastic-agent-specifying-number-of-shards-and-ilm-policy/326945/1 "2023-03-03T14:05:17Z")

</div>

Hello!

I was wondering if someone can tell me where can I specify number of shards and ILM policy for specific data stream while using Elastic Agents.

For example the default sys log data streams all use "Logs" as a default ILM policy and have one primary shard.

Where can I specify these configs and how would it look like before the data streams are already created?

Thank you!

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [March 3, 2023, 2:15pm UTC](https://discuss.elastic.co/t/elastic-agent-specifying-number-of-shards-and-ilm-policy/326945/2 "2023-03-03T14:15:41Z")

</div>

> [@Mirko\_Katunar](#):
>
> Where can I specify these configs and how would it look like before the data streams are already created?

You need to follow this documentation [here](https://www.elastic.co/guide/en/fleet/current/data-streams-ilm-tutorial.html) to create custom template, but to do that you would need to clone the current data stream template, so I don't think you can't do that before creating the data streams.

Depending on the integration you will need to create a custom template for every dataset that the integration have, which is a lot of work.

I opened [an issue](https://github.com/elastic/kibana/issues/146792) for a feature request to simplify this process and it seems that Elastic is working on it.

---

<div class="post-metadata">

**Author:** ![Mirko\_Katunar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mirko_katunar/32/118017_2.png) [@Mirko\_Katunar](https://discuss.elastic.co/u/Mirko_Katunar)\
**Post date:** [March 3, 2023, 2:42pm UTC](https://discuss.elastic.co/t/elastic-agent-specifying-number-of-shards-and-ilm-policy/326945/3 "2023-03-03T14:42:30Z")

</div>

Thank you!

I thought there would be an easier way to do that, but I guess there are still a lot of restrains while using Elastic Agents.

I will keep an eye on the mentioned issue.

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [March 3, 2023, 3:06pm UTC](https://discuss.elastic.co/t/elastic-agent-specifying-number-of-shards-and-ilm-policy/326945/4 "2023-03-03T15:06:52Z")

</div>

> [@Mirko\_Katunar](#):
>
> I thought there would be an easier way to do that, but I guess there are still a lot of restrains while using Elastic Agents.

Yeah, anything that you need to customize will give you some more work.

---

<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:** [March 31, 2023, 3:07pm UTC](https://discuss.elastic.co/t/elastic-agent-specifying-number-of-shards-and-ilm-policy/326945/5 "2023-03-31T15:07:46Z")

</div>

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