# Filebeat combines mulitple lines into one

**URL:** <https://discuss.elastic.co/t/filebeat-combines-mulitple-lines-into-one/156725>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [November 14, 2018, 6:05pm UTC](https://discuss.elastic.co/t/filebeat-combines-mulitple-lines-into-one/156725 "2018-11-14T18:05:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zahodi](https://avatars.discourse-cdn.com/v4/letter/z/e36b37/32.png) [@zahodi](https://discuss.elastic.co/u/zahodi)\
**Post date:** [November 14, 2018, 6:05pm UTC](https://discuss.elastic.co/t/filebeat-combines-mulitple-lines-into-one/156725/1 "2018-11-14T18:05:06Z")

</div>

For some reason filebeat combines multiple lines in my log into a single event. Also for some reason filebeat is not shipping the metadata for these messages and I'm not sure if it's related.

sample source lines in a file:

> 2018-11-14T17:36:02.582113+00:00 localhost dropbear[22618]: Child connection from 192.168.1.1:35362  
> 2018-11-14T17:36:02.584137+00:00 localhost dropbear[22618]: Exit before auth: Exited normally  
> 2018-11-14T17:36:21.101821+00:00 localhost python: DIGEST-MD5 common mech free  
> 2018-11-14T17:36:22.468729+00:00 localhost httpd: DIGEST-MD5 common mech free  
> 2018-11-14T17:36:58.357544+00:00 localhost python: DIGEST-MD5 common mech free

filebeat config:

> ```
> filebeat.prospectors:
> - type: log
> enabled: true
> paths:
> - /app/log/auth.log
> 
> ```

logstash config:

> input {  
> beats {  
> port =\> 5044  
> codec =\> line  
> }  
> }
> 
> filter {  
> mutate {  
> add\_field =\> { "test\_field1" =\> "testing\_field" }  
> }  
> mutate {  
> add\_field =\> { "test\_field2" =\> "%{@metadata}" }  
> }  
> }  
> output {  
> file {  
> path =\> "/var/logstash/nonparsed/output"  
> codec =\> rubydebug  
> }  
> }

file output:

> {  
> "@timestamp" =\> 2018-11-14T17:38:35.305Z,  
> "test\_field1" =\> "testing\_field",  
> "message" =\> "2018-11-14T17:36:02.582113+00:00 localhost dropbear[22618]: Child connection from 192.168.1.1:353622018-11-14T17:36:02.584137+00:00 localhost dropbear[22618]: Exit before auth: Exited normally2018-11-14T17:36:21.101821+00:00 localhost python: DIGEST-MD5 common mech free2018-11-14T17:36:22.468729+00:00 localhost httpd: DIGEST-MD5 common mech free2018-11-14T17:36:58.357544+00:00 localhost python: DIGEST-MD5 common mech free",  
> "test\_field2" =\> "{}",  
> "@version" =\> "1"  
> }

---

<div class="post-metadata">

**Author:** ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)\
**Post date:** [November 15, 2018, 3:39pm UTC](https://discuss.elastic.co/t/filebeat-combines-mulitple-lines-into-one/156725/3 "2018-11-15T15:39:42Z")

</div>

Can you post the complete filebeat configuration please?

Why did you configure the line codec with the beats input? One should not configure a codec in the beats input in Logstash.

---

<div class="post-metadata">

**Author:** ![zahodi](https://avatars.discourse-cdn.com/v4/letter/z/e36b37/32.png) [@zahodi](https://discuss.elastic.co/u/zahodi)\
**Post date:** [November 16, 2018, 6:08pm UTC](https://discuss.elastic.co/t/filebeat-combines-mulitple-lines-into-one/156725/4 "2018-11-16T18:08:12Z")

</div>

That was it! Removed the codec option and things are normal again.

---

<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 14, 2018, 6:08pm UTC](https://discuss.elastic.co/t/filebeat-combines-mulitple-lines-into-one/156725/5 "2018-12-14T18:08:16Z")

</div>

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