# Metricbeat forcing to use manually created template

**URL:** <https://discuss.elastic.co/t/metricbeat-forcing-to-use-manually-created-template/362634>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-monitoring\
**Created:** [July 5, 2024, 10:27pm UTC](https://discuss.elastic.co/t/metricbeat-forcing-to-use-manually-created-template/362634 "2024-07-05T22:27:59Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [July 6, 2024, 8:00pm UTC](https://discuss.elastic.co/t/metricbeat-forcing-to-use-manually-created-template/362634/4 "2024-07-06T20:00:18Z")

</div>

Hi @Ronaldo_Lanhellas Please share your metricbeat.yml and what version you are on.

By the way, setting up an index per app is an anti-pattern, as it potentially creates many small indices, which is not efficient. Curious why you want to do this... not to say there is not a reason but curious why.

Putting many apps in the same index / data stream is the best practice and then filter on the Query Side

for 8.14 this is a complete working metricbeat.yml

That will write to custom alias, index or data stream

```auto
metricbeat.config.modules:
  # Glob pattern for configuration loading
  path: ${path.config}/modules.d/*.yml

  # Set to true to enable config reloading
  reload.enabled: false

setup.template.enabled: false
setup.ilm.enabled: false

setup.kibana:

# ---------------------------- Elasticsearch Output ----------------------------
output.elasticsearch:
  # Array of hosts to connect to.
  hosts: ["localhost:9200"]
  index: my-metrics

```

```auto
GET _cat/indices/my-metrics?v

# Result
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size dataset.size
yellow open my-metrics tYuUH8ovRJC0rSNj2nbECw 1 1 291 0 566.4kb 566.4kb 566.4kb

```

You can also review [this post](https://discuss.elastic.co/t/metricbeat-and-heartbeat-8-x-custom-index-name-should-pickup-from-template-but-creates-always-bedefault-index-name/337557/9)

---

_[View the full topic](https://discuss.elastic.co/t/metricbeat-forcing-to-use-manually-created-template/362634)._
