# Index template and ilm conflict

**URL:** <https://discuss.elastic.co/t/index-template-and-ilm-conflict/221729>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [March 2, 2020, 4:26pm UTC](https://discuss.elastic.co/t/index-template-and-ilm-conflict/221729 "2020-03-02T16:26:56Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![chersko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chersko/32/46457_2.png) [@chersko](https://discuss.elastic.co/u/chersko)\
**Post date:** [March 2, 2020, 4:26pm UTC](https://discuss.elastic.co/t/index-template-and-ilm-conflict/221729/1 "2020-03-02T16:26:56Z")

</div>

I have the following in my `metricbeat.yml`  
"template"  
setup.template.enabled: true  
setup.template.name: "metrics\_index\_template"  
setup.template.pattern: "metrics-\*"  
setup.template.fields: "fields.yml"  
setup.template.overwrite: false  
"ILM"  
setup.ilm.enabled: true  
setup.ilm.pattern: "{now/d}-000001"  
setup.ilm.policy\_name: "metrics-ilm-policy"  
setup.ilm.check\_exists: true  
setup.ilm.overwrite: false

the behavior I expect is an Index Template named "metrics\_index\_template" and indices named "metrics-{date}-{number}" attached to an ILM policy named "metrics-ilm-policy".  
but this is not the behavior I get.

---

<div class="post-metadata">

**Author:** ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)\
**Post date:** [March 2, 2020, 6:04pm UTC](https://discuss.elastic.co/t/index-template-and-ilm-conflict/221729/2 "2020-03-02T18:04:33Z")

</div>

Hey @chersko,

> [@chersko](#):
>
> the behavior I expect is an Index Template named "metrics\_index\_template" and indices named "metrics-{date}-{number}" attached to an ILM policy named "metrics-ilm-policy".  
> but this is not the behavior I get.

What behaviour are you getting? Do some things work and others don't?

To change the index and aliases names you would also need to set `setup.ilm.rollover_alias: metrics`.

Also take into account that every time you change these settings you may need to run setup again, and you are not overwriting existing configuration (`setup.ilm.overwrite: false`).

---

<div class="post-metadata">

**Author:** ![chersko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chersko/32/46457_2.png) [@chersko](https://discuss.elastic.co/u/chersko)\
**Post date:** [March 3, 2020, 3:03am UTC](https://discuss.elastic.co/t/index-template-and-ilm-conflict/221729/3 "2020-03-03T03:03:22Z")

</div>

the behaviour I'm getting is a index template named `metricbeat-7.6.0` and indices named `metricbeat-7.6.0-2020.03.03-000001`

---

<div class="post-metadata">

**Author:** ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)\
**Post date:** [March 3, 2020, 6:33pm UTC](https://discuss.elastic.co/t/index-template-and-ilm-conflict/221729/4 "2020-03-03T18:33:42Z")

</div>

Have you tried to modify `setup.ilm.rollover_alias`?

---

<div class="post-metadata">

**Author:** ![chersko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chersko/32/46457_2.png) [@chersko](https://discuss.elastic.co/u/chersko)\
**Post date:** [March 4, 2020, 3:57pm UTC](https://discuss.elastic.co/t/index-template-and-ilm-conflict/221729/5 "2020-03-04T15:57:18Z")

</div>

yes when i modify `setup.ilm.rollover_alias: "metrics"`, the result i get is a index template named metrics which is not what i want what i want is a index template named `metrics_index_template`  
thanks for your help

---

<div class="post-metadata">

**Author:** ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)\
**Post date:** [March 4, 2020, 4:04pm UTC](https://discuss.elastic.co/t/index-template-and-ilm-conflict/221729/6 "2020-03-04T16:04:29Z")

</div>

What if you use this name for the rollover alias configuration?

```auto
setup.ilm.rollover_alias: metrics_index_template

```

Or with version:

```auto
setup.ilm.rollover_alias: "metrics_index_template-%{[agent.version]}"

```

In any case changing index and template names is complicated and error-prone, I wonder what is your use case to need this renamings.

---

<div class="post-metadata">

**Author:** ![chersko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chersko/32/46457_2.png) [@chersko](https://discuss.elastic.co/u/chersko)\
**Post date:** [March 4, 2020, 4:47pm UTC](https://discuss.elastic.co/t/index-template-and-ilm-conflict/221729/7 "2020-03-04T16:47:40Z")

</div>

the result when I edit my config to

```auto
setup.ilm.rollover_alias: "metrics_index_template"

```

is an index template named `metrics_index_template` and indices named `metrics_index_template-{date}-{number}`.  
I guess once ilm is enabled index template settings has no input on the naming scheme  
the reason I wanted to setup accordingly is that I have a lot of visualizations setup this 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:** [April 1, 2020, 4:47pm UTC](https://discuss.elastic.co/t/index-template-and-ilm-conflict/221729/8 "2020-04-01T16:47:43Z")

</div>

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