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


#1

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!


#2

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"
    ],

#3

Awesome, thank you!


(system) #4

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