# How to get logstash to parse multi-line fields into multiple lines

**URL:** https://discuss.elastic.co/t/how-to-get-logstash-to-parse-multi-line-fields-into-multiple-lines/180376
**Category:** Logstash
**Created:** [May 9, 2019, 1:53pm UTC](https://discuss.elastic.co/t/how-to-get-logstash-to-parse-multi-line-fields-into-multiple-lines/180376 "2019-05-09T13:53:30Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![thadc](https://avatars.discourse-cdn.com/v4/letter/t/7cd45c/32.png) [@thadc](https://discuss.elastic.co/u/thadc)
#### Post date: [May 9, 2019, 1:53pm UTC](https://discuss.elastic.co/t/how-to-get-logstash-to-parse-multi-line-fields-into-multiple-lines/180376/1 "2019-05-09T13:53:30Z")

</div>

Hi, we have messages input into logstash from filebeat where some fields are multi-line (e.g., like a stack trace message field). By default, after grok-parsing a field that was multi-line in the original log file , the parsed output of the field is one wrapped-around line. Is there a way to preserve the original multi-line state in the parsed output? If so, how can it be accomplished?

thanks for any response.

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [May 9, 2019, 3:34pm UTC](https://discuss.elastic.co/t/how-to-get-logstash-to-parse-multi-line-fields-into-multiple-lines/180376/2 "2019-05-09T15:34:41Z")

</div>

If you want to split a multi-line message into multiple events then you can use

```
split {}
```

---

<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: [June 6, 2019, 3:34pm UTC](https://discuss.elastic.co/t/how-to-get-logstash-to-parse-multi-line-fields-into-multiple-lines/180376/3 "2019-06-06T15:34:48Z")

</div>

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