# Batch size in logstash

**URL:** <https://discuss.elastic.co/t/batch-size-in-logstash/206919>\
**Category:** Logstash\
**Created:** [November 7, 2019, 7:53am UTC](https://discuss.elastic.co/t/batch-size-in-logstash/206919 "2019-11-07T07:53:58Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ankit\_Sawant](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ankit_sawant/32/46158_2.png) [@Ankit\_Sawant](https://discuss.elastic.co/u/Ankit_Sawant)\
**Post date:** [November 7, 2019, 7:53am UTC](https://discuss.elastic.co/t/batch-size-in-logstash/206919/1 "2019-11-07T07:53:58Z")

</div>

I have 4 events having unique Id and I am processing these event in aggregate filter but with batch size of 250. Logstash is processing these events out of order I am not getting exact result, with batch size of 2 the events are processed in order but takes too much time

---

<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 7, 2019, 7:59am UTC](https://discuss.elastic.co/t/batch-size-in-logstash/206919/2 "2019-11-07T07:59:35Z")

</div>

The aggregate filter does impose some limitations and is not always appropriate. What is the high level business problem you are trying to solve?

---

<div class="post-metadata">

**Author:** ![amanpradhan](https://avatars.discourse-cdn.com/v4/letter/a/ea5d25/32.png) [@amanpradhan](https://discuss.elastic.co/u/amanpradhan)\
**Post date:** [November 7, 2019, 8:01am UTC](https://discuss.elastic.co/t/batch-size-in-logstash/206919/3 "2019-11-07T08:01:14Z")

</div>

I am having the same problem . Does logstash processes the events out of order within a particular batch of events?

---

<div class="post-metadata">

**Author:** ![Ankit\_Sawant](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ankit_sawant/32/46158_2.png) [@Ankit\_Sawant](https://discuss.elastic.co/u/Ankit_Sawant)\
**Post date:** [November 7, 2019, 8:04am UTC](https://discuss.elastic.co/t/batch-size-in-logstash/206919/4 "2019-11-07T08:04:59Z")

</div>

I am trying to calculate time difference between two events from logs with aggregate filter, but within the same batch of events logstash processes events out of order and I am not getting the exact results always .

---

<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:** [November 7, 2019, 3:50pm UTC](https://discuss.elastic.co/t/batch-size-in-logstash/206919/5 "2019-11-07T15:50:44Z")

</div>

> [@amanpradhan](#):
>
> I am having the same problem . Does logstash processes the events out of order within a particular batch of events?

If pipeline.java\_execution is enabled (which became the default in v7.0) then logstash [will](https://github.com/elastic/logstash/issues/10938) re-order events even with pipeline.workers set to 1.

---

<div class="post-metadata">

**Author:** ![Ankit\_Sawant](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ankit_sawant/32/46158_2.png) [@Ankit\_Sawant](https://discuss.elastic.co/u/Ankit_Sawant)\
**Post date:** [November 7, 2019, 4:06pm UTC](https://discuss.elastic.co/t/batch-size-in-logstash/206919/6 "2019-11-07T16:06:33Z")

</div>

Thank you for the reply . So Setting pipeline.java\_execution :false will solve the problem of reordering right??

---

<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:** [November 7, 2019, 4:25pm UTC](https://discuss.elastic.co/t/batch-size-in-logstash/206919/7 "2019-11-07T16:25:36Z")

</div>

> [@Ankit\_Sawant](#):
>
> Setting pipeline.java\_execution :false will solve the problem of reordering

That is correct.

---

<div class="post-metadata">

**Author:** ![Ankit\_Sawant](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ankit_sawant/32/46158_2.png) [@Ankit\_Sawant](https://discuss.elastic.co/u/Ankit_Sawant)\
**Post date:** [November 9, 2019, 7:57am UTC](https://discuss.elastic.co/t/batch-size-in-logstash/206919/8 "2019-11-09T07:57:34Z")

</div>

Thank you that worked as expected .

---

<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 7, 2019, 7:57am UTC](https://discuss.elastic.co/t/batch-size-in-logstash/206919/9 "2019-12-07T07:57:36Z")

</div>

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