# Is greates store logs into one indice or store in N small indices?

**URL:** https://discuss.elastic.co/t/is-greates-store-logs-into-one-indice-or-store-in-n-small-indices/277588
**Category:** Elasticsearch
**Created:** [July 1, 2021, 6:34pm UTC](https://discuss.elastic.co/t/is-greates-store-logs-into-one-indice-or-store-in-n-small-indices/277588 "2021-07-01T18:34:43Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![guimap](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guimap/32/90813_2.png) [@guimap](https://discuss.elastic.co/u/guimap)
#### Post date: [July 1, 2021, 6:34pm UTC](https://discuss.elastic.co/t/is-greates-store-logs-into-one-indice-or-store-in-n-small-indices/277588/1 "2021-07-01T18:34:43Z")

</div>

Hi

I was wondering which is greatest way to store logs data, store into only one indice ( maybe use ILM to manager this indice ) or split in small indices (like: logs-2021.07.01, logs-2021.07.02 etc)

What the greatest way, which one is recommend ?  
There's any impact in performance if i choose the big one indice option?

Considering that elasticsearch has a limited number of shards (where the number are limited by number of nodes, right ? )  
Thanks 🙂

---

<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: [July 1, 2021, 6:41pm UTC](https://discuss.elastic.co/t/is-greates-store-logs-into-one-indice-or-store-in-n-small-indices/277588/2 "2021-07-01T18:41:15Z")

</div>

If you have log data you generally want to use time-based indices as this makes managing retention by deleting indices very efficient. Deleting from a single large index is quite costly. That said you want to make sure that your shards are not too small (aim for a few tens of GB in size as a guideline) so maybe you want to use rollover or have weekly or monthly indices depending on how much data you ingest per day.

---

<div class="post-metadata">

### Author: ![guimap](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guimap/32/90813_2.png) [@guimap](https://discuss.elastic.co/u/guimap)
#### Post date: [July 1, 2021, 6:50pm UTC](https://discuss.elastic.co/t/is-greates-store-logs-into-one-indice-or-store-in-n-small-indices/277588/3 "2021-07-01T18:50:55Z")

</div>

Thanks for reply 🙂

I have a large number of documents per index (like 6kk per index)  
Just for context:  
Today i'm saving my logs into small indices, splitted by day, But this are consuming my shards limitation,  
Can i save this logs into weekly indices instead of save it into daily indices (saving my shards limitation ) ?  
And maybe use ILM to retention old indices ?  
What do you recommend ?

---

<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: [July 1, 2021, 7:15pm UTC](https://discuss.elastic.co/t/is-greates-store-logs-into-one-indice-or-store-in-n-small-indices/277588/4 "2021-07-01T19:15:40Z")

</div>

Use time based indices but do not use daily indices if they end up being small. Instead use ILM with rollover to get to a good target size and have each index cover a longer time period.

---

<div class="post-metadata">

### Author: ![guimap](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guimap/32/90813_2.png) [@guimap](https://discuss.elastic.co/u/guimap)
#### Post date: [July 1, 2021, 10:14pm UTC](https://discuss.elastic.co/t/is-greates-store-logs-into-one-indice-or-store-in-n-small-indices/277588/5 "2021-07-01T22:14:05Z")

</div>

> [@Christian\_Dahlqvist](#):
>
> Use time based indices but do not use daily indices if they end up being small. Instead use ILM with rollover to get to a good target size and have each index cover a longer time period.

Thanks, thats what i will do.

---

<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: [July 29, 2021, 10:15pm UTC](https://discuss.elastic.co/t/is-greates-store-logs-into-one-indice-or-store-in-n-small-indices/277588/6 "2021-07-29T22:15:00Z")

</div>

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