# Parsing multiline logs of various formats

**URL:** <https://discuss.elastic.co/t/parsing-multiline-logs-of-various-formats/71972>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [January 18, 2017, 10:11am UTC](https://discuss.elastic.co/t/parsing-multiline-logs-of-various-formats/71972 "2017-01-18T10:11:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vld](https://avatars.discourse-cdn.com/v4/letter/v/3ab097/32.png) [@vld](https://discuss.elastic.co/u/vld)\
**Post date:** [January 18, 2017, 10:11am UTC](https://discuss.elastic.co/t/parsing-multiline-logs-of-various-formats/71972/1 "2017-01-18T10:11:51Z")

</div>

I have multiple multiline log files of various formats on the same machine. I ship them using one filebeat instance to logstash (deployed on another machine).  
My main issue is where/how to use the multiline option.

Initially I was using the logstash multiline codec:  
`input { beats { port => "5044" codec => multiline { pattern => "^(expr1)|(expr2)|...|(exprn)" negate => true what => previous } } }`  
Then I realized that more file formats I going to add more regex expresions _"^(expr1)|(expr2)|...|(exprn)"_ I need to create which is not easy to maintain and is not very efficient.

So I moved the multiline to the filebeat. But here there is an issue too. I can not create a multiline expression per prospector, I can only create one multiline expresion per filebeat than means the long complicated expression from previous example: _"^(expr1)|(expr2)|...|(exprn)"_  
`multiline.pattern: '^(expr1)|(expr2)|...|(exprn)' multiline.negate: false multiline.match: after`

Then I came to another solution: one filebeat per log file format containing a simple multiline expression _"^(exprX)"_. But question is how to install multiple filebeat agents on the same machine? I install it via Puppet using rpm for Redhat.

Can you please advise what would be the right choice in my case?

---

<div class="post-metadata">

**Author:** ![vld](https://avatars.discourse-cdn.com/v4/letter/v/3ab097/32.png) [@vld](https://discuss.elastic.co/u/vld)\
**Post date:** [January 18, 2017, 12:54pm UTC](https://discuss.elastic.co/t/parsing-multiline-logs-of-various-formats/71972/2 "2017-01-18T12:54:51Z")

</div>

I made a mistake in my previous post.  
I can configure a multiline rule per prospector so I do not need multiple filebeat instances.

---

<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:** [February 15, 2017, 12:54pm UTC](https://discuss.elastic.co/t/parsing-multiline-logs-of-various-formats/71972/3 "2017-02-15T12:54:54Z")

</div>

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