# Merging multiple logstash output document into one by a common field

**URL:** https://discuss.elastic.co/t/merging-multiple-logstash-output-document-into-one-by-a-common-field/161944
**Category:** Logstash
**Created:** [December 23, 2018, 8:14am UTC](https://discuss.elastic.co/t/merging-multiple-logstash-output-document-into-one-by-a-common-field/161944 "2018-12-23T08:14:21Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![abhishek021](https://avatars.discourse-cdn.com/v4/letter/a/278dde/32.png) [@abhishek021](https://discuss.elastic.co/u/abhishek021)
#### Post date: [December 23, 2018, 8:14am UTC](https://discuss.elastic.co/t/merging-multiple-logstash-output-document-into-one-by-a-common-field/161944/1 "2018-12-23T08:14:21Z")

</div>

Hi,  
I'm a beginner to logstash. I have created multiple documents based on some grok pattern for a particular log event.  
Now, before passing documents to elastic search I want to merge those documents having common field into a single document.I'm not sure if I can do this using aggregate filter.  
So either I can combine similar log events into a single log or I can merge similar output documents into one document.  
Which is better and How can I achieve this ?

---

<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: [January 20, 2019, 8:28am UTC](https://discuss.elastic.co/t/merging-multiple-logstash-output-document-into-one-by-a-common-field/161944/2 "2019-01-20T08:28:37Z")

</div>

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