# Regex compiling issues

**URL:** https://discuss.elastic.co/t/regex-compiling-issues/75910
**Category:** Beats
**Tags:** filebeat
**Created:** [February 21, 2017, 4:04pm UTC](https://discuss.elastic.co/t/regex-compiling-issues/75910 "2017-02-21T16:04:47Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ohk](https://avatars.discourse-cdn.com/v4/letter/o/dec6dc/32.png) [@ohk](https://discuss.elastic.co/u/ohk)
#### Post date: [February 21, 2017, 4:04pm UTC](https://discuss.elastic.co/t/regex-compiling-issues/75910/1 "2017-02-21T16:04:47Z")

</div>

Hi,

I have this filebeat config:

> - input\_type: log  
> # Paths that should be crawled and fetched. Glob based paths.  
> paths:  
> - /home/ohk/data/nginx.log  
> document\_type: nginx  
> multiline.pattern: ['^\b(?:\d{1,3}.){3}\d{1,3}\b']  
> multiline.negate: false  
> multiline.match: after  
> #############################################################  
> paths:  
> - /home/ohk/data/api.log  
> document\_type: api  
> multiline.pattern: ['^INFO in ']  
> multiline.negate: false  
> multiline.match: after  
> #############################################################  
> paths:  
> - /home/ohk/data/yarn.log  
> document\_type: yarn  
> multiline.pattern: ['^LogType:']  
> multiline.negate: false  
> multiline.match: after  
> ############################################################  
> paths:  
> - /home/ohk/data/worker.log  
> document\_type: worker  
> multiline.pattern: ['^INFO in ', '^[']  
> multiline.negate: false  
> multiline.match: after

In filebeat log file I don't have any errors, but the journalctl mentions this:  
\> févr. 21 16:45:45 PCB131014 systemd[1]: Stopped filebeat.

> ```
> févr. 21 16:45:45 PCB131014 systemd[1]: Started filebeat.
> févr. 21 16:45:45 PCB131014 filebeat[18126]: panic: runtime error: invalid memory address or nil pointer dereference
> févr. 21 16:45:45 PCB131014 filebeat[18126]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x5da79a]
> févr. 21 16:45:45 PCB131014 filebeat[18126]: goroutine 42 [running]:
> févr. 21 16:45:45 PCB131014 filebeat[18126]: panic(0x8f44a0, 0xc42000e030)
> févr. 21 16:45:45 PCB131014 filebeat[18126]: /usr/local/go/src/runtime/panic.go:500 +0x1a1
> févr. 21 16:45:45 PCB131014 filebeat[18126]: regexp.progMachine(0x0, 0x0, 0xc420037448)
> févr. 21 16:45:45 PCB131014 filebeat[18126]: /usr/local/go/src/regexp/exec.go:74 +0xaa
> févr. 21 16:45:45 PCB131014 filebeat[18126]: regexp.(*Regexp).get(0xc4200ad4a0, 0xc420037528)
> févr. 21 16:45:45 PCB131014 filebeat[18126]: /usr/local/go/src/regexp/regexp.go:216 +0xd4
> févr. 21 16:45:45 PCB131014 filebeat[18126]: regexp.(*Regexp).doExecute(0xc4200ad4a0, 0x0, 0x0, 0xc4200ad5e0, 0x9b, 0x9c, 0x0, 0x0, 0x0, 0x0, ...)
> févr. 21 16:45:45 PCB131014 filebeat[18126]: /usr/local/go/src/regexp/exec.go:416 +0x40
> févr. 21 16:45:45 PCB131014 filebeat[18126]: regexp.(*Regexp).Match(0xc4200ad4a0, 0xc4200ad5e0, 0x9b, 0x9c, 0x9b)
> févr. 21 16:45:45 PCB131014 filebeat[18126]: /usr/local/go/src/regexp/regexp.go:421 +0x8c
> févr. 21 16:45:45 PCB131014 filebeat[18126]: github.com/elastic/beats/filebeat/harvester/reader.genPatternMatcher.func1(0xc4200bdc00, 0x39e, 0x39f, 0xc4200ad5e0, 0x9b, 0x9c, 0x9c)
> févr. 21 16:45:45 PCB131014 filebeat[18126]: /go/src/github.com/elastic/beats/filebeat/harvester/reader/multiline.go:307 +0xa3
> févr. 21 16:45:45 PCB131014 filebeat[18126]: github.com/elastic/beats/filebeat/harvester/reader.(*Multiline).readNext(0xc420110180, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
> févr. 21 16:45:45 PCB131014 filebeat[18126]: /go/src/github.com/elastic/beats/filebeat/harvester/reader/multiline.go:189 +0x8b7
> févr. 21 16:45:45 PCB131014 filebeat[18126]: github.com/elastic/beats/filebeat/harvester/reader.(*Multiline).readFirst(0xc420110180, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc4202f0468, ...)
> févr. 21 16:45:45 PCB131014 filebeat[18126]: /go/src/github.com/elastic/beats/filebeat/harvester/reader/multiline.go:132 +0x167
> févr. 21 16:45:45 PCB131014 filebeat[18126]: github.com/elastic/beats/filebeat/harvester/reader.(*Multiline).Next(0xc420110180, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc42031ccb0, ...)
> févr. 21 16:45:45 PCB131014 filebeat[18126]: /go/src/github.com/elastic/beats/filebeat/harvester/reader/multiline.go:108 +0x62
> févr. 21 16:45:45 PCB131014 filebeat[18126]: github.com/elastic/beats/filebeat/harvester/reader.(*Limit).Next(0xc4202e8ca0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
> févr. 21 16:45:45 PCB131014 filebeat[18126]: /go/src/github.com/elastic/beats/filebeat/harvester/reader/limit.go:17 +0x66
> févr. 21 16:45:45 PCB131014 filebeat[18126]: github.com/elastic/beats/filebeat/harvester.(*Harvester).Harvest(0xc4202b9040, 0xc07180, 0xc4202e8ca0)
> févr. 21 16:45:45 PCB131014 filebeat[18126]: /go/src/github.com/elastic/beats/filebeat/harvester/log.go:93 +0x24d
> févr. 21 16:45:45 PCB131014 filebeat[18126]: github.com/elastic/beats/filebeat/prospector.(*Prospector).startHarvester.func1(0xc4200c20e0, 0xc4202b9040, 0xc07180, 0xc4202e8ca0)
> févr. 21 16:45:45 PCB131014 filebeat[18126]: /go/src/github.com/elastic/beats/filebeat/prospector/prospector.go:248 +0x65
> févr. 21 16:45:45 PCB131014 filebeat[18126]: created by github.com/elastic/beats/filebeat/prospector.(*Prospector).startHarvester
> févr. 21 16:45:45 PCB131014 filebeat[18126]: /go/src/github.com/elastic/beats/filebeat/prospector/prospector.go:249 +0x2e4
> févr. 21 16:45:45 PCB131014 systemd[1]: filebeat.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
> févr. 21 16:45:45 PCB131014 systemd[1]: filebeat.service: Unit entered failed state.
> févr. 21 16:45:45 PCB131014 systemd[1]: filebeat.service: Failed with result 'exit-code'.
> févr. 21 16:45:45 PCB131014 systemd[1]: filebeat.service: Service hold-off time over, scheduling restart.
> févr. 21 16:45:45 PCB131014 systemd[1]: Stopped filebeat.
> févr. 21 16:45:45 PCB131014 systemd[1]: filebeat.service: Start request repeated too quickly.
> févr. 21 16:45:45 PCB131014 systemd[1]: Failed to start filebeat.
> 
> ```

Is there a problem with my regex ?

Thank you in advance,

---

<div class="post-metadata">

### Author: ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)
#### Post date: [February 22, 2017, 4:31am UTC](https://discuss.elastic.co/t/regex-compiling-issues/75910/2 "2017-02-22T04:31:11Z")

</div>

> [@ohk](#):
>
> multiline.pattern: ['^\b(?:\d{1,3}.){3}\d{1,3}\b']

This value cannot be an list. So remote the `[` and `]` from around the regex.

---

<div class="post-metadata">

### Author: ![ohk](https://avatars.discourse-cdn.com/v4/letter/o/dec6dc/32.png) [@ohk](https://discuss.elastic.co/u/ohk)
#### Post date: [February 22, 2017, 9:01am UTC](https://discuss.elastic.co/t/regex-compiling-issues/75910/3 "2017-02-22T09:01:06Z")

</div>

Thank you that solved the problem

---

<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: [March 22, 2017, 9:01am UTC](https://discuss.elastic.co/t/regex-compiling-issues/75910/4 "2017-03-22T09:01:07Z")

</div>

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