# Multiple codecs? running multiline codec during filter?

**URL:** https://discuss.elastic.co/t/multiple-codecs-running-multiline-codec-during-filter/193894
**Category:** Logstash
**Created:** [August 5, 2019, 10:34pm UTC](https://discuss.elastic.co/t/multiple-codecs-running-multiline-codec-during-filter/193894 "2019-08-05T22:34:43Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![tedder](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tedder/32/42460_2.png) [@tedder](https://discuss.elastic.co/u/tedder)
#### Post date: [August 5, 2019, 10:34pm UTC](https://discuss.elastic.co/t/multiple-codecs-running-multiline-codec-during-filter/193894/1 "2019-08-05T22:34:43Z")

</div>

I have log entries coming in as a JSON payload. I'm using a json codec, then splitting the entries in a filter. My JSON looks something like this:

payload = { "date": "...", "source": "...", "entries": ["line1", "line2", " multiline line2"] }

I need multiline support, but it's a codec. As far as I can tell I need it as a filter.

Is there a way to parse JSON and _then_ run multiline as codecs? Is there another way to get multiline support?

---

<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: [August 5, 2019, 11:04pm UTC](https://discuss.elastic.co/t/multiple-codecs-running-multiline-codec-during-filter/193894/2 "2019-08-05T23:04:23Z")

</div>

> [@tedder](#):
>
> Is there a way to parse JSON and _then_ run multiline as codecs?

No, an input can only have one codec. You can use a multiline filter and then a json filter though.

---

<div class="post-metadata">

### Author: ![tedder](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tedder/32/42460_2.png) [@tedder](https://discuss.elastic.co/u/tedder)
#### Post date: [August 5, 2019, 11:26pm UTC](https://discuss.elastic.co/t/multiple-codecs-running-multiline-codec-during-filter/193894/3 "2019-08-05T23:26:48Z")

</div>

> [@Badger](#):
>
> You can use a multiline filter

So multiline can be done at the _filter_ stage? I guess I just can't find the documentation of a multiline filter, all I can find is the multiline codec. Maybe it's not [a plugin](https://www.elastic.co/guide/en/logstash/current/filter-plugins.html) but somehow native? Or a codec can be used as a filter?

---

<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: [August 6, 2019, 12:22am UTC](https://discuss.elastic.co/t/multiple-codecs-running-multiline-codec-during-filter/193894/4 "2019-08-06T00:22:49Z")

</div>

> [@Badger](#):
>
> You can use a multiline filter and then a json filter though.

Sorry, what I meant to say was "You can use a multiline codec and then a json filter"

---

<div class="post-metadata">

### Author: ![tedder](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tedder/32/42460_2.png) [@tedder](https://discuss.elastic.co/u/tedder)
#### Post date: [August 6, 2019, 12:52am UTC](https://discuss.elastic.co/t/multiple-codecs-running-multiline-codec-during-filter/193894/5 "2019-08-06T00:52:12Z")

</div>

> [@Badger](#):
>
> Sorry, what I meant to say was "You can use a multiline codec and then a json filter"

Ah.

That won't work, because my multilines are coming in as a list inside the JSON.

I see there _was_ a multiline filter that was deprecated in 2.4 or so.

I'll probably end up rewriting or adapting the logs upstream, I think.

---

<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: [September 3, 2019, 12:52am UTC](https://discuss.elastic.co/t/multiple-codecs-running-multiline-codec-during-filter/193894/6 "2019-09-03T00:52:15Z")

</div>

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