# Multiline Config Failing

**URL:** https://discuss.elastic.co/t/multiline-config-failing/47078
**Category:** Beats
**Tags:** filebeat
**Created:** [April 12, 2016, 7:40am UTC](https://discuss.elastic.co/t/multiline-config-failing/47078 "2016-04-12T07:40:55Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![dawiro](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@dawiro](https://discuss.elastic.co/u/dawiro)
#### Post date: [April 12, 2016, 7:40am UTC](https://discuss.elastic.co/t/multiline-config-failing/47078/1 "2016-04-12T07:40:55Z")

</div>

Hi,  
My filebeat prospector config looks like this:

```auto
filebeat:
    prospectors:
    - document_type: cassandra
        input_type: log
        paths:
          - /var/log/cassandra/*.log
          - /var/log/cassandra/audit/*.log
        scan_frequency: 5s
        ignore_older: 168h
        multiline:
          pattern: "^\s"
          match: after

```

However, adding the multiline config causes the prospector file to fail to load. If I remove the multiline element then the config loads fine. What is wrong with this configuration?

Regards,  
David

---

<div class="post-metadata">

### Author: ![tudor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tudor/32/3753_2.png) [@tudor](https://discuss.elastic.co/u/tudor)
#### Post date: [April 12, 2016, 12:25pm UTC](https://discuss.elastic.co/t/multiline-config-failing/47078/2 "2016-04-12T12:25:22Z")

</div>

It looks ok to me. What error do you get?

---

<div class="post-metadata">

### Author: ![tudor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tudor/32/3753_2.png) [@tudor](https://discuss.elastic.co/u/tudor)
#### Post date: [April 12, 2016, 1:52pm UTC](https://discuss.elastic.co/t/multiline-config-failing/47078/3 "2016-04-12T13:52:00Z")

</div>

Ah, I think I know what the problem is. If you use double quotes, you need to escape the backslash, `"^\\s"`. In this case, you can also go without quotes, in which case you don't need the double backslash. I recommend passing configs through [http://www.yamllint.com/](http://www.yamllint.com/) when you get weird errors like this.

---

<div class="post-metadata">

### Author: ![dawiro](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@dawiro](https://discuss.elastic.co/u/dawiro)
#### Post date: [April 12, 2016, 2:16pm UTC](https://discuss.elastic.co/t/multiline-config-failing/47078/4 "2016-04-12T14:16:33Z")

</div>

Thanks, I've tried that and get this:  
2016-04-12T15:11:54+01:00 INFO Harvester started for file: /var/log/cassandra/system.log  
2016-04-12T15:11:54+01:00 ERR Stop Harvesting. Unexpected encoding line reader error: error parsing regexp: invalid escape sequence: `\s`  
2016-04-12T15:11:54+01:00 DBG Closing file: /var/log/cassandra/system.log  
2016-04-12T15:11:54+01:00 DBG Check file for harvesting: /var/log/cassandra/audit/dropped-events.log  
2016-04-12T15:11:54+01:00 DBG Update existing file for harvesting: /var/log/cassandra/audit/dropped-events.log  
2016-04-12T15:11:54+01:00 DBG Not harvesting, file didn't change: /var/log/cassandra/audit/dropped-events.log  
2016-04-12T15:11:56+01:00 DBG Flushing spooler because of timeout. Events flushed: 0

The config loads ok and now looks like this:

```
    multiline:
      pattern: "^\\s"
      match: after

```

I've tried it without quotes and it still complains...

---

<div class="post-metadata">

### Author: ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)
#### Post date: [April 12, 2016, 4:35pm UTC](https://discuss.elastic.co/t/multiline-config-failing/47078/5 "2016-04-12T16:35:50Z")

</div>

have you tried single quotes `'` ?

---

<div class="post-metadata">

### Author: ![dawiro](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@dawiro](https://discuss.elastic.co/u/dawiro)
#### Post date: [April 13, 2016, 10:14am UTC](https://discuss.elastic.co/t/multiline-config-failing/47078/6 "2016-04-13T10:14:37Z")

</div>

Yes I have. Both lead to the same error...

---

<div class="post-metadata">

### Author: ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)
#### Post date: [April 13, 2016, 12:07pm UTC](https://discuss.elastic.co/t/multiline-config-failing/47078/7 "2016-04-13T12:07:30Z")

</div>

can you share your full filebeat.yml?

Plus, read the log message again:

```auto
2016-04-12T15:11:54+01:00 ERR Stop Harvesting. Unexpected encoding line reader error: error parsing regexp: invalid escape sequence: \s

```

It says `\s` itself is invalid, it is not saying it can not parse it. Use `[[:space:]]`. Also [check out the docs](https://www.elastic.co/guide/en/beats/filebeat/current/regexp-support.html)

---

<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 5, 2017, 9:53pm UTC](https://discuss.elastic.co/t/multiline-config-failing/47078/8 "2017-07-05T21:53:21Z")

</div>


