# Collect multiple events for processing in the filter and send to output (bulk)

**URL:** https://discuss.elastic.co/t/collect-multiple-events-for-processing-in-the-filter-and-send-to-output-bulk/300986
**Category:** Logstash
**Created:** [March 29, 2022, 3:49pm UTC](https://discuss.elastic.co/t/collect-multiple-events-for-processing-in-the-filter-and-send-to-output-bulk/300986 "2022-03-29T15:49:10Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Kosodrom](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kosodrom/32/99278_2.png) [@Kosodrom](https://discuss.elastic.co/u/Kosodrom)
#### Post date: [March 29, 2022, 3:49pm UTC](https://discuss.elastic.co/t/collect-multiple-events-for-processing-in-the-filter-and-send-to-output-bulk/300986/1 "2022-03-29T15:49:10Z")

</div>

Hi folks,

I have following use case:

I receive events from beat and would like to enrich them with additional information using a filter plugin in logstash. The filter plugin must send a request to an endpoint and retrieve information based on the event information I have received in the input. Due to massive amount if events it is not possible to send an API call for each and every one by one (otherwise I would just use http filter plugin) Usually I would collect a given amount of events (lets say 200) and send them as a bulk.

Is there such a mechanism in logstash which will allow me to collect incoming events, process them all at once in a logstash filter and proceed with output?

Thanks for any suggestions

---

<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: [March 29, 2022, 4:25pm UTC](https://discuss.elastic.co/t/collect-multiple-events-for-processing-in-the-filter-and-send-to-output-bulk/300986/2 "2022-03-29T16:25:14Z")

</div>

You may be able to do it using an aggregate filter. [This](https://discuss.elastic.co/t/logstash-http-output-plugin-customize-building-json-array-for-batching/275535) thread and the ones it links to may help you with some ideas.

---

<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: [April 26, 2022, 4:25pm UTC](https://discuss.elastic.co/t/collect-multiple-events-for-processing-in-the-filter-and-send-to-output-bulk/300986/3 "2022-04-26T16:25:25Z")

</div>

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