Fields returned on a certain index are out of scope

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 .

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