Syntax for readable long lines in logstash config

I am using a very long grok templates to parse some complex logs like mysql slow log. It looks ugly in config: very long string, full of characters like (?<z>%{ZZ})? - hard to read and hard to write. Does logstash config format support a multi-line strings, something like in python?

mystring = """very
long
but
still
readable
line"""

Hello, please reference the Logstash docs for how to do this:

https://www.elastic.co/guide/en/logstash/current/plugins-codecs-multiline.html

I am shipping multiline message altogether, so I don't need multiline codec to merge separate lines back in one message. I am happy with grok patterns like this: "(?m)%{DATA}\n%{DATA}\n%{DATA}".

I just want to make config human readable, so I need some syntax hack to split one very long line into several.

1 Like

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