# Https://www.elastic.co/guide/en/logstash/current/plugins-codecs-multiline.html

**URL:** <https://discuss.elastic.co/t/https-www-elastic-co-guide-en-logstash-current-plugins-codecs-multiline-html/69382>\
**Category:** Logstash\
**Created:** [December 19, 2016, 3:14am UTC](https://discuss.elastic.co/t/https-www-elastic-co-guide-en-logstash-current-plugins-codecs-multiline-html/69382 "2016-12-19T03:14:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![reubenpuketapu](https://avatars.discourse-cdn.com/v4/letter/r/eada6e/32.png) [@reubenpuketapu](https://discuss.elastic.co/u/reubenpuketapu)\
**Post date:** [December 19, 2016, 3:14am UTC](https://discuss.elastic.co/t/https-www-elastic-co-guide-en-logstash-current-plugins-codecs-multiline-html/69382/1 "2016-12-19T03:14:54Z")

</div>

```
filter {
multiline {
    type => "somefiletype"
    pattern => "\\$"
    what => "next"
  }
}

```

There is no explanation around what the "type" should be?? Just an update to the documentation.

Is it possible to match on a particular field i.e. specify to use the "message" part of the log.

Thanks

---

<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:** [December 19, 2016, 6:52am UTC](https://discuss.elastic.co/t/https-www-elastic-co-guide-en-logstash-current-plugins-codecs-multiline-html/69382/2 "2016-12-19T06:52:57Z")

</div>

> There is no explanation around what the "type" should be?? Just an update to the documentation.

Yeah, that's outdated stuff. Probably a copy/paste mistake from the multiline _filter_ docs. It was corrected in [update outdated doc example which used multiline filter · logstash-plugins/logstash-codec-multiline@9d4f079 · GitHub](https://github.com/logstash-plugins/logstash-codec-multiline/commit/9d4f079dde13c34a24132d9b811364f60c3ad72b) but that commit obviously hasn't reached the [elastic.co](http://elastic.co) page you looked at.

> Is it possible to match on a particular field i.e. specify to use the "message" part of the log.

In the codec context you basically just have one field (`message`) so choosing which field to act on doesn't really make sense.

---

<div class="post-metadata">

**Author:** ![reubenpuketapu](https://avatars.discourse-cdn.com/v4/letter/r/eada6e/32.png) [@reubenpuketapu](https://discuss.elastic.co/u/reubenpuketapu)\
**Post date:** [December 21, 2016, 1:57am UTC](https://discuss.elastic.co/t/https-www-elastic-co-guide-en-logstash-current-plugins-codecs-multiline-html/69382/3 "2016-12-21T01:57:06Z")

</div>

Thanks, Magnus.

Trying to work out how I can merge two logs together in the filter stage, as it cannot be done in the input..  
This is because I have to pull the actual log from a field within the message.

Original

```
2016-12-21T01:39:29Z	fluentd	{"log":"Traceback (most recent call last):\n","stream":"stderr","docker":{"container_id":"7a9b54502ad3c2664b93f3f5defce53e6243da995b17a246etc.........}

```

turns into:

```
 Traceback (most recent call last):

```

which then needs to be merged with another message:

Original:

```
2016-12-21T01:39:29Z	fluentd	{"log":" return self.run(*args, **kwargs)\n","stream":"stderr","docker":{"container_id":"7a9b54502ad3c2664b93f3f5defce53e6243da995b17a2........etc}}

```

turns into:

```
	    return self.run(*args, **kwargs)

```

ie a python trace that's already inside of a field.

Ideal outcome:

```
Traceback (most recent call last):
    return self.run(*args, **kwargs)
    raise HTTPError(http_error_msg, response=self)
etc.....

```

Thanks again!

---

<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:** [December 21, 2016, 6:38am UTC](https://discuss.elastic.co/t/https-www-elastic-co-guide-en-logstash-current-plugins-codecs-multiline-html/69382/4 "2016-12-21T06:38:02Z")

</div>

Oh, that's painful. Can't you fix the problem at the source and get it to emit reasonable log messages? If not I probably wouldn't use Logstash to untangle the log but rather use something else and have Logstash process the results.

---

<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:** [January 18, 2017, 6:38am UTC](https://discuss.elastic.co/t/https-www-elastic-co-guide-en-logstash-current-plugins-codecs-multiline-html/69382/5 "2017-01-18T06:38:10Z")

</div>

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