# Filebeat Multiline not combining lines

**URL:** https://community.graylog.org/t/filebeat-multiline-not-combining-lines/28091
**Category:** Graylog Central (peer support)
**Tags:** filebeat-linux, sidecar
**Created:** [March 14, 2023, 5:11pm UTC](https://community.graylog.org/t/filebeat-multiline-not-combining-lines/28091 "2023-03-14T17:11:11Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![sqlswerver](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@sqlswerver](https://community.graylog.org/u/sqlswerver)
#### Post date: [March 14, 2023, 5:11pm UTC](https://community.graylog.org/t/filebeat-multiline-not-combining-lines/28091/1 "2023-03-14T17:11:11Z")

</div>

**1. Describe your incident:**  
I have been attempting to follow the Filebeat docs regarding multiline parsing. Initially, I was following the latest version before realizing that Sidecar currently deploys 7.11.1. I am now following that version of the docs, still with no luck in it parsing correctly.

**2. Describe your environment:**  
Graylog 5.0, Opensearch 2.6, latest Sidecar available

Log begins with a date and timestamp such as: 2022-10-03 07:14:04,467  
The log continues, mostly without a pattern, until the next timestamp is met on a new line.

**3. What steps have you already taken to try and solve the problem?**  
I have attempted the following config below with no different results from leaving multiline out altogether:

```auto
# Needed for Graylog
fields_under_root: true
fields.collector_node_id: ${sidecar.nodeName}
fields.gl2_source_collector: ${sidecar.nodeId}

output.logstash:
   hosts: ["graylog01:5044"]
path:
  data: ${sidecar.spoolDir!"C:\\Program Files\\Graylog\\sidecar\\cache\\filebeat"}\data
  logs: ${sidecar.spoolDir!"C:\\Program Files\\Graylog\\sidecar"}\logs
filebeat.inputs:
- type: filestream
  paths:
    - C:\Path\To\*.log
  multiline.type: pattern
  multiline.pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2}'
  multiline.negate: true
  multiline.match: after
  tags: ["environment", "testing"]

```

---

<div class="post-metadata">

### Author: ![tmacgbay](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/tmacgbay/32/3878_2.png) [@tmacgbay](https://community.graylog.org/u/tmacgbay)
#### Post date: [March 14, 2023, 8:50pm UTC](https://community.graylog.org/t/filebeat-multiline-not-combining-lines/28091/2 "2023-03-14T20:50:19Z")

</div>

Since you are using `filestream` rather than `log` for your input type, you should use the updated multiline terminology. Rather than me retyping - go to [this link](https://www.elastic.co/guide/en/beats/filebeat/current/multiline-examples.html), it has all the information you need!

NOTE: check the syntax too - looks like you haven’t defined multiline as a parser…

---

<div class="post-metadata">

### Author: ![sqlswerver](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@sqlswerver](https://community.graylog.org/u/sqlswerver)
#### Post date: [March 14, 2023, 8:55pm UTC](https://community.graylog.org/t/filebeat-multiline-not-combining-lines/28091/3 "2023-03-14T20:55:11Z")

</div>

Thanks, I initially used that config though. It previously looked like this with the same result:

```auto
# Needed for Graylog
fields_under_root: true
fields.collector_node_id: ${sidecar.nodeName}
fields.gl2_source_collector: ${sidecar.nodeId}

output.logstash:
   hosts: ["graylog01:5044"]
path:
  data: ${sidecar.spoolDir!"C:\\Program Files\\Graylog\\sidecar\\cache\\filebeat"}\data
  logs: ${sidecar.spoolDir!"C:\\Program Files\\Graylog\\sidecar"}\logs
filebeat.inputs:
- type: filestream
  paths:
    - C:\Path\To\*.log
  parsers:
    - multiline:
      type: pattern
      pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2}'
      negate: true
      match: after
  tags: ["environment", "testing"]

```

I had changed to what I posted after changing the docs version from 8.6 to 7.11.

---

<div class="post-metadata">

### Author: ![gsmith](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/gsmith/32/1222_2.png) [@gsmith](https://community.graylog.org/u/gsmith)
#### Post date: [March 15, 2023, 12:41am UTC](https://community.graylog.org/t/filebeat-multiline-not-combining-lines/28091/4 "2023-03-15T00:41:44Z")

</div>

Hey @sqlswerver

Does this look like your Filebeat Log Collector configuration?

Example:

 ![image](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/2X/4/434230245160115a3c89eca49348b73f14fd1df2.png)

---

<div class="post-metadata">

### Author: ![gsmith](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/gsmith/32/1222_2.png) [@gsmith](https://community.graylog.org/u/gsmith)
#### Post date: [March 15, 2023, 1:42am UTC](https://community.graylog.org/t/filebeat-multiline-not-combining-lines/28091/5 "2023-03-15T01:42:01Z")

</div>

Hey @sqlswerver

I did a mockup in my lab with your configurations and the logs came through. Think you might be missing a step, not sure thou.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/2X/1/1906a5296e3bfe8d30fc550aa097646dad627082.png)  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/2X/a/a01da055fa618ed35792683219cdaa1094ba5a4d.png)  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/2X/0/0917ba014744c725209548fad6f9d269b9cfeec8.png)

results:

 ![image](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/2X/a/aa2ab5e0644c829522f7fe94cbcad515e4ed711b.png)  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/2X/8/8caff50df8ea8cdbc6d3fee3f04f8c461bd1a476.png)

---

<div class="post-metadata">

### Author: ![sqlswerver](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@sqlswerver](https://community.graylog.org/u/sqlswerver)
#### Post date: [March 15, 2023, 1:32pm UTC](https://community.graylog.org/t/filebeat-multiline-not-combining-lines/28091/6 "2023-03-15T13:32:09Z")

</div>

Thanks for the replies. My configuration looks identical to yours currently and it’s not that I’m not receiving logs or my tags are incorrect, it’s the fact that the logs are not coming across as multiline. See below:

 ![image](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/2X/c/cc0f9f8502d92c2d496c2d1f5dd806c5851e0234.png)  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/2X/5/5e070eed72bfe600bebbf528c49ac6986c057f63.png)

Results:

 ![image](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/2X/4/45458e4ae71c8c59cbfca5c5ec2bdf5976f944f9.png)

In this case I would expect the `2023-03-13 15:27:57,109` message and the lines below it within the file up until another timestamp to be a single message.

---

<div class="post-metadata">

### Author: ![sqlswerver](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@sqlswerver](https://community.graylog.org/u/sqlswerver)
#### Post date: [March 15, 2023, 2:02pm UTC](https://community.graylog.org/t/filebeat-multiline-not-combining-lines/28091/7 "2023-03-15T14:02:14Z")

</div>

I’ve figured out the issue. In the version of Filebeat that sidecar is using, 7.11, filestream is still experimental and the multiline functionality is not supported for it. After changing back to `log` and setting the `multiline.` fields, it is now working as expected. Is there going to be an update to the Beats included in Sidecar at any point?

---

<div class="post-metadata">

### Author: ![gsmith](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/gsmith/32/1222_2.png) [@gsmith](https://community.graylog.org/u/gsmith)
#### Post date: [March 15, 2023, 9:12pm UTC](https://community.graylog.org/t/filebeat-multiline-not-combining-lines/28091/8 "2023-03-15T21:12:09Z")

</div>

Hello @sqlswerver

> [@sqlswerver](#):
>
> Is there going to be an update to the Beats included in Sidecar at any point?

Normally there will be an update, but not sure when. Glad you reolved it.

---

<div class="post-metadata">

### Author: ![tmacgbay](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/tmacgbay/32/3878_2.png) [@tmacgbay](https://community.graylog.org/u/tmacgbay)
#### Post date: [March 16, 2023, 1:12pm UTC](https://community.graylog.org/t/filebeat-multiline-not-combining-lines/28091/9 "2023-03-16T13:12:55Z")

</div>

It is posibile to use newer versions of beats - just note that field naming can change between versions… I think between 7.11 and the current, it some fields changed … then changed back in later versions because of outcry… at least I happened to see it that way.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/3X/c/7/c7c09c6b5099570133d6502b83f50ba4430de5b6.png) [@system](https://community.graylog.org/u/system)
#### Post date: [March 30, 2023, 1:13pm UTC](https://community.graylog.org/t/filebeat-multiline-not-combining-lines/28091/10 "2023-03-30T13:13:19Z")

</div>

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