I have a custom grok pattern file with following regex patterns. I successfully tested these using regex online tool and it works fine however logstash fails to load the custom patterns file - see below. Appreciate your input.
Custom Regex:
LEVEL \[[A-Z][A-Z][A-Z][A-Z]*. *\]
CODE [[a-z][a-z][a-z]*. *\]
Input:
[2019-01-08 01:49:04] [INFO ] [abcd] No data file found, creating one and starting executor
Logstash config:
filter {
grok {
patterns_dir => ["/usr/share/logstash/pipeline/patterns"]
match => { "message" => "%{LEVEL:level} %{CODE:code}" }
}
}
Error
premature end of char-class: /(?LEVEL:level[[A-Z][A-Z][A-Z][A-Z]*. ]) (?CODE:code[[a-z][a-z][a-z]. *])/m>,