# Aggregate different inputs

**URL:** <https://discuss.elastic.co/t/aggregate-different-inputs/131509>\
**Category:** Logstash\
**Created:** [May 11, 2018, 3:53pm UTC](https://discuss.elastic.co/t/aggregate-different-inputs/131509 "2018-05-11T15:53:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![elk2](https://avatars.discourse-cdn.com/v4/letter/e/f14d63/32.png) [@elk2](https://discuss.elastic.co/u/elk2)\
**Post date:** [May 11, 2018, 3:53pm UTC](https://discuss.elastic.co/t/aggregate-different-inputs/131509/1 "2018-05-11T15:53:46Z")

</div>

It's possible to aggregate different input files content?

Example:  
file1.txt  
May 1 15:57:11 myhost sshd[34427]: pam\_unix(sshd:session): session opened for user hendrenj by (uid=0)  
May 1 16:16:13 myhost sshd[34427]: pam\_unix(sshd:session): session closed for user hendrenj  
May 5 14:27:09 myhost sshd[43553]: pam\_unix(sshd:session): session opened for user hendrenj by (uid=0)  
May 5 18:23:41 myhost sshd[43553]: pam\_unix(sshd:session): session closed for user hendrenj

file2.txt  
user hendrenj connected from 43.3.21.157 at May 1 15:50:01  
user hendrenj disconnected from 43.3.21.157 at May 1 16:51:32  
user hendrenj connected from 43.3.21.157 at May 5 14:10:35  
user hendrenj disconnected from 43.3.21.157 at May 5 20:10:22

I want an output like this:  
file3.txt  
at May 1 15:50:01 user hendrenj connected from 43.3.21.157  
at May 1 15:57:11 session opened for user hendrenj by (uid=0)  
at May 1 16:16:13 session closed for user hendrenj  
at May 1 16:51:32 user hendrenj disconnected from 43.3.21.157  
at May 5 14:10:35 user hendrenj connected from 43.3.21.157  
at May 5 14:27:09 session opened for user hendrenj by (uid=0)  
at May 5 18:23:41 session closed for user hendrenj  
at May 5 20:10:22 user hendrenj disconnected from 43.3.21.157

Do you have some ideas?

---

<div class="post-metadata">

**Author:** ![atira](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/atira/32/28699_2.png) [@atira](https://discuss.elastic.co/u/atira)\
**Post date:** [June 8, 2018, 6:38am UTC](https://discuss.elastic.co/t/aggregate-different-inputs/131509/3 "2018-06-08T06:38:21Z")

</div>

Just use a grok filter with 2 patterns and set the file output plugin accordingly.

---

<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:** [July 6, 2018, 6:38am UTC](https://discuss.elastic.co/t/aggregate-different-inputs/131509/4 "2018-07-06T06:38:36Z")

</div>

Closed on July 6, 2018, 6:38am UTC

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