# How to reduce Metricbeat index file size?

**URL:** <https://discuss.elastic.co/t/how-to-reduce-metricbeat-index-file-size/330630>\
**Category:** Metrics\
**Created:** [April 24, 2023, 10:14am UTC](https://discuss.elastic.co/t/how-to-reduce-metricbeat-index-file-size/330630 "2023-04-24T10:14:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nitin08bisht](https://avatars.discourse-cdn.com/v4/letter/n/7cd45c/32.png) [@Nitin08bisht](https://discuss.elastic.co/u/Nitin08bisht)\
**Post date:** [April 24, 2023, 10:14am UTC](https://discuss.elastic.co/t/how-to-reduce-metricbeat-index-file-size/330630/1 "2023-04-24T10:14:20Z")

</div>

Hi,

How can I reduce the metricbeat index file size as it is taking more storage for per day logs, please help me.

Thanks & regards,  
Nitin Bisht

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [April 24, 2023, 11:58am UTC](https://discuss.elastic.co/t/how-to-reduce-metricbeat-index-file-size/330630/2 "2023-04-24T11:58:51Z")

</div>

> [@Nitin08bisht](#):
>
> How can I reduce the metricbeat index file size as it is taking more storage for per day logs, please help me.

You have two options basically, reduce the metrics you are monitoring or increase the monitoring interval.

Per default metricbeat uses a 10 seconds interval, you could increase it to 15 or higher to reduce the amount of data.

---

<div class="post-metadata">

**Author:** ![Nitin08bisht](https://avatars.discourse-cdn.com/v4/letter/n/7cd45c/32.png) [@Nitin08bisht](https://discuss.elastic.co/u/Nitin08bisht)\
**Post date:** [April 25, 2023, 4:26am UTC](https://discuss.elastic.co/t/how-to-reduce-metricbeat-index-file-size/330630/3 "2023-04-25T04:26:08Z")

</div>

Thanks! @leandrojmp for your reply.  
Could you please suggest me how we can reduce the metrics or increase the monitoring interval time.

---

<div class="post-metadata">

**Author:** ![syed0510](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@syed0510](https://discuss.elastic.co/u/syed0510)\
**Post date:** [April 26, 2023, 8:02am UTC](https://discuss.elastic.co/t/how-to-reduce-metricbeat-index-file-size/330630/4 "2023-04-26T08:02:00Z")

</div>

Thanks! @leandrojmp for your reply.  
Could you please suggest me how we can reduce the metrics or increase the monitoring interval time.

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [April 26, 2023, 11:42am UTC](https://discuss.elastic.co/t/how-to-reduce-metricbeat-index-file-size/330630/5 "2023-04-26T11:42:24Z")

</div>

It is in the [documentation](https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-metricbeat.html), did you check it?

You would need to edit each module you are using in metricbeat and change the `period` value to increase it.

Depending on the module you are using you can also remove metricsets that you do not want, for example, the [system module](https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-module-system.html#_example_configuration_59) you may edit it and leave only metrics about _cpu_, _load_ and _memory_.

It is a compromising, or you increase the disk size or you reduce the data you collect, there is not much else to do.

---

<div class="post-metadata">

**Author:** ![Nitin08bisht](https://avatars.discourse-cdn.com/v4/letter/n/7cd45c/32.png) [@Nitin08bisht](https://discuss.elastic.co/u/Nitin08bisht)\
**Post date:** [May 3, 2023, 7:26pm UTC](https://discuss.elastic.co/t/how-to-reduce-metricbeat-index-file-size/330630/6 "2023-05-03T19:26:38Z")

</div>

Thanks @leandrojmp, your solution is helpful. I have change `period` 10s to 30s and remove metricsets from `metricbeat.yml` file which I do not want. Also I have changed period 10s to 30s from all enable module files and observed its behavior for few days. Now, the size of index is half as compared to earlier.

```auto
metricbeat.modules:

#-------------------------------- System Module --------------------------------
- module: system
  metricsets:
    - cpu # CPU usage
    #- load # CPU load averages
    - memory # Memory usage
    - network # Network IO
    - process # Per process metrics
    - process_summary # Process summary
    - uptime # System Uptime
    #- socket_summary # Socket summary
    #- Users
    #- uptime
    #- core # Per CPU core usage
    #- diskio # Disk IO
    #- filesystem # File system usage for each mountpoint
    #- fsstat # File system summary metrics
    #- raid # Raid
    #- socket # Sockets and connection info (linux only)
    #- service # systemd service information
  enabled: true
  period: 30s
  processes: ['.*']

```

---

<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:** [May 31, 2023, 7:27pm UTC](https://discuss.elastic.co/t/how-to-reduce-metricbeat-index-file-size/330630/7 "2023-05-31T19:27:17Z")

</div>

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