# How can I assign number of Replica shards at the time of Dynamic Index creation?

**URL:** https://discuss.elastic.co/t/how-can-i-assign-number-of-replica-shards-at-the-time-of-dynamic-index-creation/97694
**Category:** Elasticsearch
**Created:** [August 20, 2017, 4:32pm UTC](https://discuss.elastic.co/t/how-can-i-assign-number-of-replica-shards-at-the-time-of-dynamic-index-creation/97694 "2017-08-20T16:32:58Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![rajesh](https://avatars.discourse-cdn.com/v4/letter/r/8e7dd6/32.png) [@rajesh](https://discuss.elastic.co/u/rajesh)
#### Post date: [August 20, 2017, 4:32pm UTC](https://discuss.elastic.co/t/how-can-i-assign-number-of-replica-shards-at-the-time-of-dynamic-index-creation/97694/1 "2017-08-20T16:32:58Z")

</div>

Hi All,

I am trying to index logs using logstash to a dynamic index with the format "index=\>sample-%{[YYYY.MM](http://YYYY.MM)}". How can I assign number of Replica shards at the time of Dynamic Index creation?

---

<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: [August 20, 2017, 5:00pm UTC](https://discuss.elastic.co/t/how-can-i-assign-number-of-replica-shards-at-the-time-of-dynamic-index-creation/97694/2 "2017-08-20T17:00:13Z")

</div>

You can set it through an [index template](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/indices-templates.html).

---

<div class="post-metadata">

### Author: ![rajesh](https://avatars.discourse-cdn.com/v4/letter/r/8e7dd6/32.png) [@rajesh](https://discuss.elastic.co/u/rajesh)
#### Post date: [August 20, 2017, 5:12pm UTC](https://discuss.elastic.co/t/how-can-i-assign-number-of-replica-shards-at-the-time-of-dynamic-index-creation/97694/3 "2017-08-20T17:12:50Z")

</div>

Hi Christian,

Thanks for the quick reply..

So, I think I will have to add number\_of\_replicas field to the settings block. And I don't understand what mappings, properties and created at block do? Can you please explain it?

---

<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: [September 17, 2017, 5:13pm UTC](https://discuss.elastic.co/t/how-can-i-assign-number-of-replica-shards-at-the-time-of-dynamic-index-creation/97694/4 "2017-09-17T17:13:17Z")

</div>

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