# Assigning ILM for metricbeat

**URL:** <https://discuss.elastic.co/t/assigning-ilm-for-metricbeat/253160>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [October 23, 2020, 3:57pm UTC](https://discuss.elastic.co/t/assigning-ilm-for-metricbeat/253160 "2020-10-23T15:57:48Z")\
**Posts on this page:** 7\
**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:** [October 23, 2020, 3:57pm UTC](https://discuss.elastic.co/t/assigning-ilm-for-metricbeat/253160/1 "2020-10-23T15:57:48Z")

</div>

I have started metricbeat used custome field.yml file to load template.  
I have following in metricbeat.yml

setup.template.fields: "fields.yml"  
setup.ilm.enabled: auto  
setup.template.overwrite: true

now I started metricbeat on remote system and send data to logstash, it did created index  
metricbeat-7.9.1 but didn't had any ILM assign. I am trying to assign ILM to that index and gives me this error. what am I doing wrong?

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/3/4/3457dd3eb738dfc5206477534f32ccdbbc7f0cf1.png)

---

<div class="post-metadata">

**Author:** ![ChrsMark](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chrsmark/32/55858_2.png) [@ChrsMark](https://discuss.elastic.co/u/ChrsMark)\
**Post date:** [October 26, 2020, 9:17am UTC](https://discuss.elastic.co/t/assigning-ilm-for-metricbeat/253160/2 "2020-10-26T09:17:49Z")

</div>

Hi!

From [Configure index lifecycle management | Metricbeat Reference [8.11] | Elastic](https://www.elastic.co/guide/en/beats/metricbeat/current/ilm.html#setup-ilm-option:)

> When `auto` (the default) is specified on version 7.0 and later, Metricbeat automatically uses index lifecycle management if the feature is enabled in Elasticsearch and has the required license; otherwise, Metricbeat creates daily indices.

Can you check if it could be a licence issue or if your Elasticsearch is properly configured?

---

<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:** [October 26, 2020, 1:37pm UTC](https://discuss.elastic.co/t/assigning-ilm-for-metricbeat/253160/3 "2020-10-26T13:37:42Z")

</div>

yes I do have setup.ilm.enable:auto

this is running basic license.

I delete everything, recreated everything but still same. Data is coming from logstash and has following. It does create this index properly when I start logstash "metricbeat-7.9.1"

output {  
elasticsearch {  
hosts =\> ["elktst02:9200","elktst03:9200"]  
index =\> "%{[@metadata][beat]}-%{[@metadata][version]}"  
user =\> "elastic"  
password =\> "changeme"  
}  
stdout { codec =\> json\_lines }  
}

and this is metricbeat.yml

setup.template.fields: "fields.yml"  
setup.ilm.enabled: auto  
setup.ilm.rollover\_alias: "metricbeat-%{[agent.version]}"  
setup.ilm.pattern: "{now/d}-000001"  
setup.template.overwrite: true  
setup.template.settings:  
index.number\_of\_shards: 1  
index.codec: best\_compression

---

<div class="post-metadata">

**Author:** ![ChrsMark](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chrsmark/32/55858_2.png) [@ChrsMark](https://discuss.elastic.co/u/ChrsMark)\
**Post date:** [October 27, 2020, 9:46am UTC](https://discuss.elastic.co/t/assigning-ilm-for-metricbeat/253160/4 "2020-10-27T09:46:01Z")

</div>

Did you run `metricbeat setup`? [https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-template.html#load-template-manually](https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-template.html#load-template-manually)

This will be needed in order to properly setup the indexes and ilms defined in Metricbeat config.

---

<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:** [November 16, 2020, 4:13am UTC](https://discuss.elastic.co/t/assigning-ilm-for-metricbeat/253160/5 "2020-11-16T04:13:34Z")

</div>

I did went through that whole document many time over. Need help telling me exactly what I need. getting very confused. what I need is  
metricbeat name = metricbeat-%{[agent.version]}

and then when it rolls over it should be just metricbeat-%{[agent.version]}-yyyy.dd-00001

this is what I have in metricbeat.yml file

```
setup.template.fields: "fields.yml"
setup.ilm.enabled: auto
setup.ilm.rollover_alias: "metricbeat-%{[agent.version]}"
setup.ilm.pattern: "{+yyyy.MM}-000001"
setup.template.overwrite: true
setup.ilm.overwrite: true

```

and then from logstash I am creating index = metricbeat-7.9.3

---

<div class="post-metadata">

**Author:** ![ChrsMark](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chrsmark/32/55858_2.png) [@ChrsMark](https://discuss.elastic.co/u/ChrsMark)\
**Post date:** [November 16, 2020, 9:49am UTC](https://discuss.elastic.co/t/assigning-ilm-for-metricbeat/253160/6 "2020-11-16T09:49:08Z")

</div>

Hi!

Running `metricbeat setup --index-management -E output.logstash.enabled=false -E 'output.elasticsearch.hosts=["localhost:9200"]' ` with the proper hosts defined will do the setup.  
I would suggest trying this incrementally so as to figure out what exactly configuration you need.  
For example I would try with:

```auto
setup.template.name: "your_template_name"
setup.template.fields: "path/to/fields.yml"
setup.template.overwrite: true
setup.template.pattern: "some-*"

```

Then if you verify that it works you can add more settings like `ilm` etc.

C.

---

<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:** [December 14, 2020, 11:49am UTC](https://discuss.elastic.co/t/assigning-ilm-for-metricbeat/253160/7 "2020-12-14T11:49:11Z")

</div>

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