Does the multiline codec plugin in Logstash include newline characters in the output string?

I'm wondering if the multiline codec plugin in Logstash includes newlines in the output? I want to use regex on the output and this is important to understand in order to design my regex and have it perform well.

Looking at the documentation at https://www.elastic.co/guide/en/logstash/current/plugins-codecs-multiline.html I don't see any mention of this. FWIW I think the behavior should be documented.

Thanks!

Yes, it does. With this config

input{
        stdin{
                codec => multiline { 
                        pattern => "^}"
                        negate => true 
                        what => next 
                } 
        }
}
output { stdout { codec => rubydebug } }

and this input

{
}
{
}

the messages you get contain 1 newline

       "message" => "{\n}",
          "tags" => [
        [0] "multiline"
    ],
1 Like

Awesome, thank you!

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