# Mixed line types JSON and Plain Text in the same file with multiline

**URL:** <https://discuss.elastic.co/t/mixed-line-types-json-and-plain-text-in-the-same-file-with-multiline/319648>\
**Category:** Logstash\
**Created:** [November 23, 2022, 10:53am UTC](https://discuss.elastic.co/t/mixed-line-types-json-and-plain-text-in-the-same-file-with-multiline/319648 "2022-11-23T10:53:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sirReeall](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sirreeall/32/94713_2.png) [@sirReeall](https://discuss.elastic.co/u/sirReeall)\
**Post date:** [November 23, 2022, 10:53am UTC](https://discuss.elastic.co/t/mixed-line-types-json-and-plain-text-in-the-same-file-with-multiline/319648/1 "2022-11-23T10:53:45Z")

</div>

Hello,

I've got log files that can contain plain text lines from a Java application and JSON lines.

To complicate matters the plain text lines can be multiline , for example a Java stack trace, so I'm using the multiline codec in the input configuration. This doesn't play nice with the JSON lines as they match the multiline codec's pattern.

I was wondering how I can handle this in logstash?

I've tried:

- conditionals in the input, but this doesn't work and isn't designed to work.
- multiple pipeline to pipeline communication with an first pipeline detecting `{` and distributing to a JSON or Plain text pipeline, but I cannot use the multiline codec on the second pipeline, obviously as event could appear out of order.

Anyone have any other ideas I could test out?

---

<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 21, 2022, 10:54am UTC](https://discuss.elastic.co/t/mixed-line-types-json-and-plain-text-in-the-same-file-with-multiline/319648/2 "2022-12-21T10:54:44Z")

</div>

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