# Fields returned on a certain index are out of scope

**URL:** <https://discuss.elastic.co/t/fields-returned-on-a-certain-index-are-out-of-scope/303133>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [April 25, 2022, 9:03am UTC](https://discuss.elastic.co/t/fields-returned-on-a-certain-index-are-out-of-scope/303133 "2022-04-25T09:03:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Draken](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/draken/32/104710_2.png) [@Draken](https://discuss.elastic.co/u/Draken)\
**Post date:** [April 25, 2022, 9:03am UTC](https://discuss.elastic.co/t/fields-returned-on-a-certain-index-are-out-of-scope/303133/1 "2022-04-25T09:03:14Z")

</div>

Hello, we are currently working on a monitoring application which utilizes `Elasticsearch` for data storage, we are working with `Elasticsearch 7.17.0` and currently using `RestHighLevelClient` to interact with it from our application, we also have a service that returns the names of the fields for a certain index, but noticed that for indices sharing the same `index_template` it will return all the fields in the template.  
We also have a `Metricbeat 7.17.0` instance running and that saves each `metricset` in a separate index using the name of the `metricset` but they all fall under the same template which we setup using `metricbeat`.  
So the point is when we request fields for a certain `metricbeat` index it returns all the fields in the template (even fields for modules that are not Enabled) and this has a huge performance issue on the application, so i wanted to ask if there is way to tell `metricbeat` to setup for each `metricset` or if not possible for each `module` it's own template ?

And if is undoable with `metricbeat` directly is there another way via `Elasticsearch` or programmatically via the `RestHighLevelClient` API ?

And Thank You .

---

<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:** [May 23, 2022, 9:03am UTC](https://discuss.elastic.co/t/fields-returned-on-a-certain-index-are-out-of-scope/303133/2 "2022-05-23T09:03:33Z")

</div>

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