# Use of metadata in ILM configuration

**URL:** <https://discuss.elastic.co/t/use-of-metadata-in-ilm-configuration/182918>\
**Category:** Logstash\
**Created:** [May 27, 2019, 1:22pm UTC](https://discuss.elastic.co/t/use-of-metadata-in-ilm-configuration/182918 "2019-05-27T13:22:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harm](https://avatars.discourse-cdn.com/v4/letter/h/b4bc9f/32.png) [@Harm](https://discuss.elastic.co/u/Harm)\
**Post date:** [May 27, 2019, 1:22pm UTC](https://discuss.elastic.co/t/use-of-metadata-in-ilm-configuration/182918/1 "2019-05-27T13:22:12Z")

</div>

Hi!

We have a logstash server that should be able to handle different types of beats. Previously we used an index pattern like this:  
index =\> "%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}"

Now, I'm trying to enable ILM. Since different types of beats are used, my thought was to put the metadata in the ilm\_ configuration fields, like this:

ilm\_rollover\_alias =\> "%{[@metadata][beat]}-%{[@metadata][version]}"  
ilm\_pattern =\> "{now/d}-000001"  
ilm\_policy =\> "%{[@metadata][beat]}-%{[@metadata][version]}"

The corresponding rollover\_alias and policy (e.g. metricbeat-7.0.0) already exists.

This configuration throws errors like:

[2019-05-27T15:15:09,712][ERROR][logstash.outputs.elasticsearch] Failed to install template. {:message=\>"Malformed escape pair at index 11: /\_template/%{[@metadata][beat]}-%{[@metadata][version]}", :class=\>"Java::JavaNet::URISyntaxException"

Is this syntax supported? Or is there any other way to set ILM configurations for multiple beats?

---

<div class="post-metadata">

**Author:** ![Flavio\_Pompermaier](https://avatars.discourse-cdn.com/v4/letter/f/54ee81/32.png) [@Flavio\_Pompermaier](https://discuss.elastic.co/u/Flavio_Pompermaier)\
**Post date:** [June 3, 2019, 9:29am UTC](https://discuss.elastic.co/t/use-of-metadata-in-ilm-configuration/182918/2 "2019-06-03T09:29:19Z")

</div>

Same error..

---

<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:** [July 1, 2019, 9:29am UTC](https://discuss.elastic.co/t/use-of-metadata-in-ilm-configuration/182918/3 "2019-07-01T09:29:23Z")

</div>

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