# Different ILM alias based on fields like indeces

**URL:** <https://discuss.elastic.co/t/different-ilm-alias-based-on-fields-like-indeces/266919>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [March 11, 2021, 10:13am UTC](https://discuss.elastic.co/t/different-ilm-alias-based-on-fields-like-indeces/266919 "2021-03-11T10:13:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![abev](https://avatars.discourse-cdn.com/v4/letter/a/e9a140/32.png) [@abev](https://discuss.elastic.co/u/abev)\
**Post date:** [March 11, 2021, 10:13am UTC](https://discuss.elastic.co/t/different-ilm-alias-based-on-fields-like-indeces/266919/1 "2021-03-11T10:13:42Z")

</div>

hey guys, I’m trying to send different logs to different ILM aliases  
I’ve found it here for indexes: [Configure the Elasticsearch output | Filebeat Reference [7.11] | Elastic](https://www.elastic.co/guide/en/beats/filebeat/current/elasticsearch-output.html#indices-option-es)  
and here for ILM: [Configure index lifecycle management | Filebeat Reference [7.11] | Elastic](https://www.elastic.co/guide/en/beats/filebeat/current/ilm.html#setup-ilm-rollover_alias-option)  
I’ve set my config like this:  
`setup.ilm.rollover_alias: 'filebeat_%{[fields.indexalias]}_write'`  
and in the input.d/1.yml I set

```auto
    - add_fields:
           target: ""
           fields:
             indexalias: "uno"

```

while on 2.yml I set

```auto
   - add_fields:
           target: ""
           fields:
             indexalias: "due"

```

the only result I got even with different combination of  
`%{[fields.indexalias]}`  
is  
`Exiting: failed to read the ilm rollover alias: key not found`  
any idea?

---

<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 8, 2021, 12:13pm UTC](https://discuss.elastic.co/t/different-ilm-alias-based-on-fields-like-indeces/266919/2 "2021-04-08T12:13:43Z")

</div>

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