# Indexes rolling over due to ILM are not adding an alias

**URL:** <https://discuss.elastic.co/t/indexes-rolling-over-due-to-ilm-are-not-adding-an-alias/304150>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [May 6, 2022, 5:47pm UTC](https://discuss.elastic.co/t/indexes-rolling-over-due-to-ilm-are-not-adding-an-alias/304150 "2022-05-06T17:47:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![perfecto25](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/perfecto25/32/38070_2.png) [@perfecto25](https://discuss.elastic.co/u/perfecto25)\
**Post date:** [May 6, 2022, 5:47pm UTC](https://discuss.elastic.co/t/indexes-rolling-over-due-to-ilm-are-not-adding-an-alias/304150/1 "2022-05-06T17:47:41Z")

</div>

Hello, is it possible to configure Filebeat, Metricbeat, etc to automaticlaly create an alias whenever the index rolls over a to a new one due to ILM lifecycle policy?,

ie, my index for Fbeat rolled over due to ILM policy, the new index is filebeat-7.17.0-2022.04.25 (it doesnt have "filebeat" as an alias)

Im getting this in filebeat log on the host

```auto
filebeat: 2022-05-06T13:32:10.934-0400#011ERROR#011[publisher_pipeline_output]#011pipeline/output.go:154#011Failed to connect to backoff(elasticsearch(https://elk.corp.com:9200)): Connection marked as failed because the onConnect callback failed: resource 'filebeat-7.17.0' exists, but it is not an alias

```

right now I have to manually update all indexes with an alias,

```auto
    POST /_aliases
    {
    "actions" : [
        { "add" : { "index" : "filebeat-7.17.0-2022.03.01", "alias" : "filebeat" } }
    ]
    }

```

is there a setting Im missing so this auto-adds a "filebeat" alias to each new rolled over indx

also, is there a way to alert if a certain index is not getting fed into Elasticsearch? I just realized my prod servers werent sending any filebeat data due to this alias error.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [May 7, 2022, 12:44am UTC](https://discuss.elastic.co/t/indexes-rolling-over-due-to-ilm-are-not-adding-an-alias/304150/2 "2022-05-07T00:44:14Z")

</div>

Problem most likely is at some point you accidentally deleted the alias and then filebeat started writing an actual index with the alias name. This is a pretty common error.

Then it will never roll over.

If you just run setup it will recreate the alias unless there's already a real index with that name, which is probably the situation you're in... So running set up will not work in this case.

You Will need to clean up the index that has the alias name and then run set up again and it should all be ready to go.

---

<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:** [June 4, 2022, 12:45am UTC](https://discuss.elastic.co/t/indexes-rolling-over-due-to-ilm-are-not-adding-an-alias/304150/3 "2022-06-04T00:45:10Z")

</div>

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