# Shard Allocation after new indexes is created

**URL:** <https://discuss.elastic.co/t/shard-allocation-after-new-indexes-is-created/207162>\
**Category:** Elasticsearch\
**Created:** [November 8, 2019, 7:41pm UTC](https://discuss.elastic.co/t/shard-allocation-after-new-indexes-is-created/207162 "2019-11-08T19:41:12Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marcell0e](https://avatars.discourse-cdn.com/v4/letter/m/ebca7d/32.png) [@Marcell0e](https://discuss.elastic.co/u/Marcell0e)\
**Post date:** [November 8, 2019, 7:41pm UTC](https://discuss.elastic.co/t/shard-allocation-after-new-indexes-is-created/207162/1 "2019-11-08T19:41:12Z")

</div>

When my indexes rolled over nothing is being written to the new index. How can I fix this?

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

---

<div class="post-metadata">

**Author:** ![Marcell0e](https://avatars.discourse-cdn.com/v4/letter/m/ebca7d/32.png) [@Marcell0e](https://discuss.elastic.co/u/Marcell0e)\
**Post date:** [November 13, 2019, 1:49pm UTC](https://discuss.elastic.co/t/shard-allocation-after-new-indexes-is-created/207162/2 "2019-11-13T13:49:56Z")

</div>

Anyone have any thoughts?

Thanks

---

<div class="post-metadata">

**Author:** ![Marcell0e](https://avatars.discourse-cdn.com/v4/letter/m/ebca7d/32.png) [@Marcell0e](https://discuss.elastic.co/u/Marcell0e)\
**Post date:** [November 18, 2019, 3:03pm UTC](https://discuss.elastic.co/t/shard-allocation-after-new-indexes-is-created/207162/3 "2019-11-18T15:03:44Z")

</div>

I might be on the right track but need some help on fixing the issue. I think I have configured Logstash to send all data to a specific index but not sure how to configure the handling of the rollover?

```
output {
  if [@metadata][pipeline] {
    elasticsearch {
    hosts => ["http://10.3.200.45:9200", "http://10.3.200.46:9200"]
	index => "%{[@metadata][beat]}-%{[@metadata][version]}-000001"
      pipeline => "%{[@metadata][pipeline]}" 
    }
  } else {
    elasticsearch {
    hosts => ["http://10.3.200.45:9200", "http://10.3.200.46:9200"]
	index => "%{[@metadata][beat]}-%{[@metadata][version]}-000001"
    }
  }
}
```

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [November 19, 2019, 6:39am UTC](https://discuss.elastic.co/t/shard-allocation-after-new-indexes-is-created/207162/4 "2019-11-19T06:39:37Z")

</div>

That indeed looks incorrect. You are supposed to [index into the write alias](https://www.elastic.co/guide/en/elasticsearch/reference/7.4/using-policies-rollover.html), not a specific index.

---

<div class="post-metadata">

**Author:** ![Marcell0e](https://avatars.discourse-cdn.com/v4/letter/m/ebca7d/32.png) [@Marcell0e](https://discuss.elastic.co/u/Marcell0e)\
**Post date:** [November 19, 2019, 3:51pm UTC](https://discuss.elastic.co/t/shard-allocation-after-new-indexes-is-created/207162/5 "2019-11-19T15:51:31Z")

</div>

How would I go about getting that fixed without breaking something else?

Can I set the ILM Pattern in the Logstash Conf file?

Thank you

---

<div class="post-metadata">

**Author:** ![Marcell0e](https://avatars.discourse-cdn.com/v4/letter/m/ebca7d/32.png) [@Marcell0e](https://discuss.elastic.co/u/Marcell0e)\
**Post date:** [November 20, 2019, 8:47pm UTC](https://discuss.elastic.co/t/shard-allocation-after-new-indexes-is-created/207162/6 "2019-11-20T20:47:03Z")

</div>

In my Logstash Conf file will this fix my issue? Do I have to enable ILM and then change my index to the following?

`index => "%{[@metadata][beat]}-%{[@metadata][version]}"`

Thank you for your help

---

<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 18, 2019, 8:47pm UTC](https://discuss.elastic.co/t/shard-allocation-after-new-indexes-is-created/207162/7 "2019-12-18T20:47:08Z")

</div>

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