# Number of primary shards

**URL:** <https://discuss.elastic.co/t/number-of-primary-shards/157471>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [November 20, 2018, 5:48am UTC](https://discuss.elastic.co/t/number-of-primary-shards/157471 "2018-11-20T05:48:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sahere37](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@sahere37](https://discuss.elastic.co/u/sahere37)\
**Post date:** [November 20, 2018, 5:48am UTC](https://discuss.elastic.co/t/number-of-primary-shards/157471/1 "2018-11-20T05:48:17Z")

</div>

hi,  
I am using filebeat to ship logs into elasticsearch,  
in the filebeat.yml, we can define number of primary shards of created index.  
I am creating a weekly index as following:  
index: "myn-%{+yyyy.ww}"

and the size of logs (which their path defined in filebeat.yml in the filebeat.inputs part ) is around 50G per week. according these, how should i set the number of primary shards in the following part:  
index.number\_of\_shards: ?

It is noted that, we will delete the indices that are alive more than 3 months

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [November 20, 2018, 6:56am UTC](https://discuss.elastic.co/t/number-of-primary-shards/157471/2 "2018-11-20T06:56:06Z")

</div>

I would set it to 2, that gives you some room to grow.

---

<div class="post-metadata">

**Author:** ![sahere37](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@sahere37](https://discuss.elastic.co/u/sahere37)\
**Post date:** [November 20, 2018, 7:11am UTC](https://discuss.elastic.co/t/number-of-primary-shards/157471/3 "2018-11-20T07:11:21Z")

</div>

thanks, the default is 3, should i used less than 3?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [November 20, 2018, 8:35am UTC](https://discuss.elastic.co/t/number-of-primary-shards/157471/4 "2018-11-20T08:35:38Z")

</div>

If you're asking the question then you care enough to get an answer right 😉

If so, then yes, go with 2. And then when you start to get ~100GB indices then move to 3.

---

<div class="post-metadata">

**Author:** ![sahere37](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@sahere37](https://discuss.elastic.co/u/sahere37)\
**Post date:** [November 21, 2018, 6:57am UTC](https://discuss.elastic.co/t/number-of-primary-shards/157471/5 "2018-11-21T06:57:04Z")

</div>

Many thanks

---

<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 19, 2018, 6:57am UTC](https://discuss.elastic.co/t/number-of-primary-shards/157471/6 "2018-12-19T06:57:09Z")

</div>

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