# Custom metricbeat index,ilm

**URL:** https://discuss.elastic.co/t/custom-metricbeat-index-ilm/260249
**Category:** Beats
**Tags:** metricbeat
**Created:** [January 5, 2021, 6:10pm UTC](https://discuss.elastic.co/t/custom-metricbeat-index-ilm/260249 "2021-01-05T18:10:54Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)
#### Post date: [January 5, 2021, 6:10pm UTC](https://discuss.elastic.co/t/custom-metricbeat-index-ilm/260249/1 "2021-01-05T18:10:55Z")

</div>

I have follwing setting on metricbeat.yml

setup.template.enabled: true  
setup.template.overwrite: true

output.elasticsearch.index: "hou\_metricbeat\_insite-%{[agent.version]}-%{+yyyy.MM.dd}"  
setup.template.name: "hou\_metricbeat\_insite"  
setup.template.pattern: "hou\_metricbeat\_insite-\*"  
setup.template.fields: "fields.yml"

setup.ilm.enabled: auto  
setup.ilm.rollover\_alias: "hou\_metricbeat\_insite"  
setup.ilm.pattern: "{now/d}-000001"

it does create index called hou\_metricbeat\_insite-{date} no agent.version there.

I even try %{agent.version} but no luck.

it does creates index, and ILM policy. but without agent.version

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [January 5, 2021, 10:34pm UTC](https://discuss.elastic.co/t/custom-metricbeat-index-ilm/260249/2 "2021-01-05T22:34:31Z")

</div>

> [@elasticforme](#):
>
> output.elasticsearch.index: "hou\_metricbeat\_insite-%{[agent.version]}-%{+yyyy.MM.dd}"

and

> [@elasticforme](#):
>
> setup.ilm.rollover\_alias: "hou\_metricbeat\_insite"

Don't align. If you want to use ILM then you need to write directly to the alias and then let ILM create the underlying index name.

---

<div class="post-metadata">

### Author: ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)
#### Post date: [January 6, 2021, 3:00pm UTC](https://discuss.elastic.co/t/custom-metricbeat-index-ilm/260249/3 "2021-01-06T15:00:33Z")

</div>

alright use this and it worked. I just have to create ilm policy and link with index.

```
setup.template.enabled: true
setup.template.overwrite: true
output.elasticsearch.index: "metricbeat_insite-*"
setup.template.name: "metricbeat_insite"
setup.template.pattern: "metricbeat_insite-*"

setup.template.fields: "/etc/metricbeat/fields.yml"
setup.ilm.overwrite: true
setup.ilm.enabled: auto
setup.ilm.rollover_alias: "metricbeat_insite-%{[agent.version]}"
setup.ilm.pattern: "{now/d}-000001"

```

and I guess I can now disable setup.templae.overwrite. to avoide overwriting anything at next restart

---

<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: [February 3, 2021, 5:00pm UTC](https://discuss.elastic.co/t/custom-metricbeat-index-ilm/260249/4 "2021-02-03T17:00:37Z")

</div>

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