# Stream Identity in Multiline Codec?

**URL:** <https://discuss.elastic.co/t/stream-identity-in-multiline-codec/55437>\
**Category:** Logstash\
**Created:** [July 13, 2016, 6:45pm UTC](https://discuss.elastic.co/t/stream-identity-in-multiline-codec/55437 "2016-07-13T18:45:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maxwell\_Flanders](https://avatars.discourse-cdn.com/v4/letter/m/eb8c5e/32.png) [@Maxwell\_Flanders](https://discuss.elastic.co/u/Maxwell_Flanders)\
**Post date:** [July 13, 2016, 6:45pm UTC](https://discuss.elastic.co/t/stream-identity-in-multiline-codec/55437/1 "2016-07-13T18:45:09Z")

</div>

does the multiline codec have any ability to give your own definition of stream identity?? I am feeding logstash from a SINGLE kafka topic using a multiline codec, but some are from different sources. Can I configure the multiline codec with a stream identity such that it stacks logs from different sources separately??

I have been told not to use the multiline filter as it is deprecated.

---

<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:** [July 14, 2016, 6:07am UTC](https://discuss.elastic.co/t/stream-identity-in-multiline-codec/55437/2 "2016-07-14T06:07:21Z")

</div>

What's posting the logs into Kafka? You'll always want to do multiline processing as close to the source as possible. While I agree that stream identity support in the multiline codec is desirable it's often the wrong way of solving the problem.

---

<div class="post-metadata">

**Author:** ![Maxwell\_Flanders](https://avatars.discourse-cdn.com/v4/letter/m/eb8c5e/32.png) [@Maxwell\_Flanders](https://discuss.elastic.co/u/Maxwell_Flanders)\
**Post date:** [July 14, 2016, 12:00pm UTC](https://discuss.elastic.co/t/stream-identity-in-multiline-codec/55437/3 "2016-07-14T12:00:22Z")

</div>

We are feeding our logs into kafka using a tool called logspout which essentially just listens to the stdout of docker containers and ships that data line-by-line to wherever we tell it to. Unfortunately it is an extremely lightweight shipper tool without I think any multiline capabilities. Another option that' I've considered but been unable to make work is to send stack-traces inside of json fields, but I have as of yet been able to make this work, if I send logstash this object:

`{ "field1": "value1", "stackTraceField1": "stackTraceLine1\nstackTraceLine2\nstacTraceLine3" }`

it unfortunately seems to send those newlines through literally, but so far no luck with this approach either 😕

---

<div class="post-metadata">

**Author:** ![Maxwell\_Flanders](https://avatars.discourse-cdn.com/v4/letter/m/eb8c5e/32.png) [@Maxwell\_Flanders](https://discuss.elastic.co/u/Maxwell_Flanders)\
**Post date:** [July 14, 2016, 2:30pm UTC](https://discuss.elastic.co/t/stream-identity-in-multiline-codec/55437/4 "2016-07-14T14:30:32Z")

</div>

I guess a good question would be, is there a way to send multiline messages TO logstash, instead of concatenating them there? One option is to use beats as shippers, I know they have a multiline capability, unfortunately, they do not fit into our current logging framework.

---

<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, 4:48am UTC](https://discuss.elastic.co/t/stream-identity-in-multiline-codec/55437/5 "2017-07-06T04:48:03Z")

</div>


