# Multiline is not getting added to the "tag" field

**URL:** <https://discuss.elastic.co/t/multiline-is-not-getting-added-to-the-tag-field/142377>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [July 31, 2018, 1:52pm UTC](https://discuss.elastic.co/t/multiline-is-not-getting-added-to-the-tag-field/142377 "2018-07-31T13:52:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Emanuel9](https://avatars.discourse-cdn.com/v4/letter/e/45deac/32.png) [@Emanuel9](https://discuss.elastic.co/u/Emanuel9)\
**Post date:** [July 31, 2018, 1:52pm UTC](https://discuss.elastic.co/t/multiline-is-not-getting-added-to-the-tag-field/142377/1 "2018-07-31T13:52:11Z")

</div>

This [post](https://discuss.elastic.co/t/add-multiline-to-tags-field/41285) says that multiline got added to the tags field. Sadly, it doesn't work for me. When I view the processed multiline message in kibana, the tags field says "beats\_input\_codec\_plain\_applied".  
I need to do some special filtering when a multiline message is processed. I technically have a workaround by adding a new field that triggers with the same condition as the multiline event. (as it is explained [here](https://www.elastic.co/guide/en/beats/filebeat/6.1/include-fields.html))

I also found someone else having troubles with this ( [here](https://stackoverflow.com/questions/43995488/filebeat-multiline-tag-is-not-getting-added-for-multiline-event) ).  
Does anyone know if we are just missing out on a parameter to add the multiline to tags, or is there something else wrong?

My filebeatconf:

```
filebeat:
  prospectors:
    -
      input_type: log
      paths:
        - "/tmp/logfiles/mylogfile.log"
      document_type: mylog
      multiline:
        pattern: ": {3}"
        match: after
```

---

<div class="post-metadata">

**Author:** ![Andrew\_Cholakian1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_cholakian1/32/3612_2.png) [@Andrew\_Cholakian1](https://discuss.elastic.co/u/Andrew_Cholakian1)\
**Post date:** [July 31, 2018, 7:24pm UTC](https://discuss.elastic.co/t/multiline-is-not-getting-added-to-the-tag-field/142377/2 "2018-07-31T19:24:34Z")

</div>

Looking at the [relevant PR](https://github.com/elastic/beats/pull/2279/files), it doesn't look like a tag is supposed to be set, but rather the field `multiline.lines`. Have you checked to see if that was set?

---

<div class="post-metadata">

**Author:** ![Emanuel9](https://avatars.discourse-cdn.com/v4/letter/e/45deac/32.png) [@Emanuel9](https://discuss.elastic.co/u/Emanuel9)\
**Post date:** [August 1, 2018, 6:08am UTC](https://discuss.elastic.co/t/multiline-is-not-getting-added-to-the-tag-field/142377/3 "2018-08-01T06:08:54Z")

</div>

I checked that now, but when I view the message in kibana, it doesn't show the field `multiline.lines`. In addition, I checked the fields in the index pattern, and the mentioned field isn't listed there either.

---

<div class="post-metadata">

**Author:** ![Emanuel9](https://avatars.discourse-cdn.com/v4/letter/e/45deac/32.png) [@Emanuel9](https://discuss.elastic.co/u/Emanuel9)\
**Post date:** [August 2, 2018, 10:28am UTC](https://discuss.elastic.co/t/multiline-is-not-getting-added-to-the-tag-field/142377/4 "2018-08-02T10:28:26Z")

</div>

I have now tried my above-mentioned workaround by using processors but that doesn't work sadly.

```
filebeat:
  prospectors:
    -
      input_type: log
      paths:
        - "/tmp/logfiles/mylogfile.log"
      document_type: mylog
      #close_older: 36h
      multiline:
        pattern: ": {3}"
        match: after
      processors:
        - include_fields:
            when.regexp.message: ": {3}"
            fields: ["multilineevent", "@version", "@timestamp", "message", "tags"]
      fields_under_root: true

```

The multiline part works, but it basically ignores the whole processors part. Am I doing something wrong? Is there any other way to to tell my filter that there is a multiline event happening?

---

<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:** [August 30, 2018, 10:28am UTC](https://discuss.elastic.co/t/multiline-is-not-getting-added-to-the-tag-field/142377/5 "2018-08-30T10:28:29Z")

</div>

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