# Logstash multiline Bug

**URL:** <https://discuss.elastic.co/t/logstash-multiline-bug/38483>\
**Category:** Logstash\
**Created:** [January 6, 2016, 9:22am UTC](https://discuss.elastic.co/t/logstash-multiline-bug/38483 "2016-01-06T09:22:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![KarouiMourad](https://avatars.discourse-cdn.com/v4/letter/k/bb73d2/32.png) [@KarouiMourad](https://discuss.elastic.co/u/KarouiMourad)\
**Post date:** [January 6, 2016, 9:22am UTC](https://discuss.elastic.co/t/logstash-multiline-bug/38483/1 "2016-01-06T09:22:22Z")

</div>

Hello,

I have a problem to parse this type of log :

2015-12-05 20:08:17,689 INFO applicationhistoryservice.ApplicationHistoryServer (LogAdapter.java:info(45)) - STARTUP\_MSG:  
/\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
STARTUP\_MSG: Starting ApplicationHistoryServer  
STARTUP\_MSG: host = centos1/10.0.0.4  
STARTUP\_MSG: args = []  
STARTUP\_MSG: version = 2.7.1.2.3.2.0-2950

When i use this site : [http://grokconstructor.appspot.com/](http://grokconstructor.appspot.com/)  
and i put those logs and i put this pattern :

%{TIMESTAMP\_ISO8601} %{LOGLEVEL} %{DATA:service} (%{DATA:what}) - STARTUP\_MSG:\n%{DATA:delete}\nSTARTUP\_MSG: Starting %{DATA:starting}\nSTARTUP\_MSG: host = %{DATA:host}\nSTARTUP\_MSG: args = %{DATA:args}\nSTARTUP\_MSG: version = %{GREEDYDATA:version}

and for the multiline i use the "^%{TIMESTAMP\_ISO8601} " pattern and negate to true  
and this works perfectly.

But with logstash it doesn't work at all.  
Please i need help.  
Thank you in advance.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [January 6, 2016, 11:28am UTC](https://discuss.elastic.co/t/logstash-multiline-bug/38483/2 "2016-01-06T11:28:34Z")

</div>

I think you need to prepend the grok expression with `(?m)` so that the regexp engine doesn't consider a newline character as the end of the string. See [http://stackoverflow.com/a/28231905/414355](http://stackoverflow.com/a/28231905/414355) for an example.

---

<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, 2017, 5:16am UTC](https://discuss.elastic.co/t/logstash-multiline-bug/38483/3 "2017-07-06T05:16:40Z")

</div>


