# Aggregate logs when fields are common in events

**URL:** <https://discuss.elastic.co/t/aggregate-logs-when-fields-are-common-in-events/139768>\
**Category:** Logstash\
**Created:** [July 12, 2018, 1:41pm UTC](https://discuss.elastic.co/t/aggregate-logs-when-fields-are-common-in-events/139768 "2018-07-12T13:41:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![saad](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/saad/32/17214_2.png) [@saad](https://discuss.elastic.co/u/saad)\
**Post date:** [July 12, 2018, 1:41pm UTC](https://discuss.elastic.co/t/aggregate-logs-when-fields-are-common-in-events/139768/1 "2018-07-12T13:41:56Z")

</div>

How can I aggregate events in logstash whenever let say the sourceAddress, username and sitename fields are equal in events and be aggregated in one event

for example the events below:  
10.40.1.10 - James - [facebook.com](http://facebook.com)  
10.40.1.10 - James - [google.com](http://google.com)  
10.40.1.12 - Katy - [twitter.com](http://twitter.com)  
10.40.1.10 - James - [facebook.com](http://facebook.com)

---

<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:** [August 9, 2018, 1:41pm UTC](https://discuss.elastic.co/t/aggregate-logs-when-fields-are-common-in-events/139768/2 "2018-08-09T13:41:58Z")

</div>

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