# Is there any way to reduce the size of data before indexing into elasticserch

**URL:** <https://discuss.elastic.co/t/is-there-any-way-to-reduce-the-size-of-data-before-indexing-into-elasticserch/270072>\
**Category:** Logstash\
**Created:** [April 14, 2021, 1:30am UTC](https://discuss.elastic.co/t/is-there-any-way-to-reduce-the-size-of-data-before-indexing-into-elasticserch/270072 "2021-04-14T01:30:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![iammanmale](https://avatars.discourse-cdn.com/v4/letter/i/5e9695/32.png) [@iammanmale](https://discuss.elastic.co/u/iammanmale)\
**Post date:** [April 14, 2021, 1:30am UTC](https://discuss.elastic.co/t/is-there-any-way-to-reduce-the-size-of-data-before-indexing-into-elasticserch/270072/1 "2021-04-14T01:30:32Z")

</div>

As our data size is quite big, we wish to reduce the size of the record. Is it possible to do some kind of aggregation before indexing into ES in logstash? For example, it is possible to put only the record of the max value of specific field over 1 min into ES index ? Or just put one of every 10 records into ES index?

---

<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:** [April 14, 2021, 1:33am UTC](https://discuss.elastic.co/t/is-there-any-way-to-reduce-the-size-of-data-before-indexing-into-elasticserch/270072/2 "2021-04-14T01:33:53Z")

</div>

Yep, take a look at the [aggregate filter](https://www.elastic.co/guide/en/logstash/current/plugins-filters-aggregate.html).

Alternatively, you can ingest the data and then use rollups in Elasticsearch - [Rolling up historical data | Elasticsearch Guide [7.12] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/xpack-rollup.html)

---

<div class="post-metadata">

**Author:** ![iammanmale](https://avatars.discourse-cdn.com/v4/letter/i/5e9695/32.png) [@iammanmale](https://discuss.elastic.co/u/iammanmale)\
**Post date:** [April 14, 2021, 1:41am UTC](https://discuss.elastic.co/t/is-there-any-way-to-reduce-the-size-of-data-before-indexing-into-elasticserch/270072/3 "2021-04-14T01:41:29Z")

</div>

Thank you for quick reply. Let me have a look.  
By the way, is it possible to accomplish the same thing on filebeat to reduce the network loading?

---

<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:** [April 14, 2021, 1:42am UTC](https://discuss.elastic.co/t/is-there-any-way-to-reduce-the-size-of-data-before-indexing-into-elasticserch/270072/4 "2021-04-14T01:42:29Z")

</div>

Looking at the Filebeat docs, it doesn't look like it.

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [April 14, 2021, 1:49am UTC](https://discuss.elastic.co/t/is-there-any-way-to-reduce-the-size-of-data-before-indexing-into-elasticserch/270072/5 "2021-04-14T01:49:34Z")

</div>

> [@iammanmale](#):
>
> Or just put one of every 10 records into ES index?

That is a use-case specifically [addressed](https://www.elastic.co/guide/en/logstash/current/plugins-filters-ruby.html#_inline_ruby_code) in the documentation.

---

<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 12, 2021, 1:50am UTC](https://discuss.elastic.co/t/is-there-any-way-to-reduce-the-size-of-data-before-indexing-into-elasticserch/270072/6 "2021-05-12T01:50:06Z")

</div>

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