# Filebeat Parsing for Multiline including previous lines from the log

**URL:** <https://discuss.elastic.co/t/filebeat-parsing-for-multiline-including-previous-lines-from-the-log/186645>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [June 20, 2019, 9:55am UTC](https://discuss.elastic.co/t/filebeat-parsing-for-multiline-including-previous-lines-from-the-log/186645 "2019-06-20T09:55:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![abinashkd](https://avatars.discourse-cdn.com/v4/letter/a/a9a28c/32.png) [@abinashkd](https://discuss.elastic.co/u/abinashkd)\
**Post date:** [June 20, 2019, 9:55am UTC](https://discuss.elastic.co/t/filebeat-parsing-for-multiline-including-previous-lines-from-the-log/186645/1 "2019-06-20T09:55:09Z")

</div>

Hi,

I am trying to parse a log which have the context as below:

> [2019-06-20 08:51:10]  
> Build ID: XXXXX  
> Build time: XXXXX  
> Application version: XXXXX  
> Category: XXXXX  
> Message: Nested Exception  
> StackTrace:
> 
> java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly ended
> 
> ```
> XXXXXXXXXXXXXXXXXX
> 
> ```

filebeat.yml file:

multiline.pattern: 'Build ID'  
multiline.negate: true  
multiline.match: after  
multiline.max\_lines: 10

How can I include the timestamp[2019-06-20 08:51:10] of the log in filebeat parsing i.e is there any way so that the previous line of pattern matching can be considered.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Mario\_Castro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mario_castro/32/35107_2.png) [@Mario\_Castro](https://discuss.elastic.co/u/Mario_Castro)\
**Post date:** [June 24, 2019, 8:55am UTC](https://discuss.elastic.co/t/filebeat-parsing-for-multiline-including-previous-lines-from-the-log/186645/2 "2019-06-24T08:55:40Z")

</div>

Hi @abinashkd 🙂

I'm afraid that or you _add_ before the pattern or after, but you cannot add _before_ and _after_ the match.

You should try to match the timestamp and use the _after_ match

---

<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 22, 2019, 8:55am UTC](https://discuss.elastic.co/t/filebeat-parsing-for-multiline-including-previous-lines-from-the-log/186645/3 "2019-07-22T08:55:42Z")

</div>

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