# How to reduce the log size?

**URL:** <https://discuss.elastic.co/t/how-to-reduce-the-log-size/106903>\
**Category:** Elasticsearch\
**Created:** [November 8, 2017, 3:56pm UTC](https://discuss.elastic.co/t/how-to-reduce-the-log-size/106903 "2017-11-08T15:56:32Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![manojcts91](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@manojcts91](https://discuss.elastic.co/u/manojcts91)\
**Post date:** [November 8, 2017, 3:56pm UTC](https://discuss.elastic.co/t/how-to-reduce-the-log-size/106903/1 "2017-11-08T15:56:32Z")

</div>

Hi Team,

Sorry if this question is already answered. I have a serious problem, My each log in Elasticsearch is about 2 MB (My indices now are around 350 GB), I am confused Is that the expected behavior from Elasticsearch or some weird going on my application ?

Thanks in advance.

---

<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 8, 2017, 4:03pm UTC](https://discuss.elastic.co/t/how-to-reduce-the-log-size/106903/2 "2017-11-08T16:03:40Z")

</div>

What is the total raw data volume you have ingested?

---

<div class="post-metadata">

**Author:** ![manojcts91](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@manojcts91](https://discuss.elastic.co/u/manojcts91)\
**Post date:** [November 8, 2017, 4:46pm UTC](https://discuss.elastic.co/t/how-to-reduce-the-log-size/106903/3 "2017-11-08T16:46:13Z")

</div>

I am sorry, How can I check the data volume ?

---

<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 8, 2017, 5:04pm UTC](https://discuss.elastic.co/t/how-to-reduce-the-log-size/106903/4 "2017-11-08T17:04:08Z")

</div>

What does the [cat indices API](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/cat-indices.html) say about this index/indices? How large are your raw documents?

---

<div class="post-metadata">

**Author:** ![manojcts91](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@manojcts91](https://discuss.elastic.co/u/manojcts91)\
**Post date:** [November 8, 2017, 5:27pm UTC](https://discuss.elastic.co/t/how-to-reduce-the-log-size/106903/5 "2017-11-08T17:27:05Z")

</div>

/var/lib/elasticsearch/nodes/0/indices ----\> 312G

I went into particular index then i have --\> 0 1 2 3 4 \_state (states)

/var/lib/elasticsearch/nodes/0/indices/03ZVSj4iQvW8sQziqfKfsg/0/index ---\> i have docs here

where all the docs are around --\> 260K

---

<div class="post-metadata">

**Author:** ![manojcts91](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@manojcts91](https://discuss.elastic.co/u/manojcts91)\
**Post date:** [November 8, 2017, 5:39pm UTC](https://discuss.elastic.co/t/how-to-reduce-the-log-size/106903/6 "2017-11-08T17:39:08Z")

</div>

just to be clear i have 40 indices now which takes ~ 312G

---

<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 8, 2017, 5:50pm UTC](https://discuss.elastic.co/t/how-to-reduce-the-log-size/106903/7 "2017-11-08T17:50:10Z")

</div>

What is the output of the API I asked about?

---

<div class="post-metadata">

**Author:** ![manojcts91](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@manojcts91](https://discuss.elastic.co/u/manojcts91)\
**Post date:** [November 8, 2017, 6:13pm UTC](https://discuss.elastic.co/t/how-to-reduce-the-log-size/106903/8 "2017-11-08T18:13:28Z")

</div>

Below are the samples

Nov -2  
green open logstash-2017.11.02 -thc3P\_8TjmMUkkDntpKGQ 5 1 61648586 0 19.7gb 9.8gb

Nov -1  
green open logstash-2017.11.01 tJJ3LosfTASQ3PBJ4x8\_gw 5 1 65746826 0 21.9gb 10.9gb

---

<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 8, 2017, 6:43pm UTC](https://discuss.elastic.co/t/how-to-reduce-the-log-size/106903/9 "2017-11-08T18:43:02Z")

</div>

It looks like each record takes up around 170 bytes per shard. If you are looking to reduce this I would recommend optimise your mappings as described in [the documentation](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/tune-for-disk-usage.html#tune-for-disk-usage) and this [blog post](https://www.elastic.co/blog/filebeat-modiles-access-logs-and-elasticsearch-storage-requirements).

---

<div class="post-metadata">

**Author:** ![manojcts91](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@manojcts91](https://discuss.elastic.co/u/manojcts91)\
**Post date:** [November 8, 2017, 9:29pm UTC](https://discuss.elastic.co/t/how-to-reduce-the-log-size/106903/10 "2017-11-08T21:29:26Z")

</div>

Thanks for the info, will check the documention

---

<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 6, 2017, 9:29pm UTC](https://discuss.elastic.co/t/how-to-reduce-the-log-size/106903/11 "2017-12-06T21:29:33Z")

</div>

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