# Metricbeat not creating Index correctly

**URL:** https://discuss.elastic.co/t/metricbeat-not-creating-index-correctly/285863
**Category:** Beats
**Tags:** metricbeat
**Created:** [October 5, 2021, 1:49am UTC](https://discuss.elastic.co/t/metricbeat-not-creating-index-correctly/285863 "2021-10-05T01:49:37Z")
**Posts on this page:** 1
**Showing post:** 3

<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: [October 8, 2021, 4:13am UTC](https://discuss.elastic.co/t/metricbeat-not-creating-index-correctly/285863/3 "2021-10-08T04:13:48Z")

</div>

> [@mhare](#):
>
> So we stopped metricbeat, and deleted all of the Metricbeat indexes. happens when you accidentally delete the write alias.

So when you did that you deleted the write alias `metricbeat-7.13.4` as well besides the actual indexes with the data in it. You don't want to do that.

When you initially ran setup the `metricbeat-7.13.4` write alias was created it looked something like this you can read about them [here](https://www.elastic.co/guide/en/elasticsearch/reference/7.15/aliases.html#write-index). They are part of ILM. running setup will re-create it.

```auto
  "metricbeat-7.13.4-2021.10.07-000001" : {
    "aliases" : {
      "metricbeat-7.13.4" : {
        "is_write_index" : true
      }

```

When working properly, metricbeat writes to `metricbeat-7.13.4` which is alias to the real index `metricbeat-7.13.4-2021.10.07-000001`

When the index rolls over another write alias is created and so on.

```auto
  "metricbeat-7.13.4-2021.10.08-000002" : {
    "aliases" : {
      "metricbeat-7.13.4" : {
        "is_write_index" : true
      }

```

(and the old one is no longer the write alias. ` "is_write_index" : false`

When you deleted the alias and restarted metricbeat now the docs get written to `metricbeat-7.13.4` because it is no longer aliased and it will no longer roll over etc.

Unfortunately you will need to delete that index and then run set up again.

You need to delete that new real index because its named the same as the write index... A case of name collision.

Need to clean it up, And then be careful not to delete it in the future.  
🙂

---

_[View the full topic](https://discuss.elastic.co/t/metricbeat-not-creating-index-correctly/285863)._
