# Change number of shards and refresh interval for all datastreams of Elastic Agent

**URL:** <https://discuss.elastic.co/t/change-number-of-shards-and-refresh-interval-for-all-datastreams-of-elastic-agent/349725>\
**Category:** Elastic Agent\
**Created:** [December 20, 2023, 1:14pm UTC](https://discuss.elastic.co/t/change-number-of-shards-and-refresh-interval-for-all-datastreams-of-elastic-agent/349725 "2023-12-20T13:14:35Z")\
**Posts on this page:** 2\
**Page:** 1

<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:** [December 20, 2023, 1:14pm UTC](https://discuss.elastic.co/t/change-number-of-shards-and-refresh-interval-for-all-datastreams-of-elastic-agent/349725/1 "2023-12-20T13:14:35Z")

</div>

Hello,

Currently all the data collected by the Elastic Agent integrations uses a default number of shards of `1` and a refresh interval of `1s`, those configurations are not optimal for our use case and are starting to impact our cluster.

We want to change these numbers, but we couldn't find a place where we can do that **once** and the change is applied to all data streams.

First question is, where is the `number_of_shards` and `refresh_interval` being set? Is it hardcoded somewhere?

Also, each dataset in every integration has a template, the recommended way to make custom settings on templates is unmanageable as it requires to clone the template for every dataset and make changes, for example the Google Workspace integration has 14 datasets, we would need to manage 14 custom templates just for one integration.

Is there any template or component template that we could change to make those changes **globally**? It doesn't matter if it is a managed template if this is the only way.

---

<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:** [January 17, 2024, 1:14pm UTC](https://discuss.elastic.co/t/change-number-of-shards-and-refresh-interval-for-all-datastreams-of-elastic-agent/349725/2 "2024-01-17T13:14:55Z")

</div>

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