Logstash is waiting for new line even if in content is XML and multiline codec is used

Logstash version: 5.1

I have not formatted xml files (each xml is in one line) and there is no new line. Im using multiline codec:
file {
path => "/data/xmls/**/.xml"
codec => multiline
{
pattern => ".
"
negate => true
what => "next"
}
}
...
filter {
xml {
...
}
...

Logstash don't parse this files because he is waiting for new line. But my question is why he is waiting for new line even in multiline codec is information about xml end tag ???

Hi @mich32,

from the docs of the file input:

By default, each event is assumed to be one line and a line is taken to be the text before a newline character. Normally, logging will add a newline to the end of each line written.

The file input assumes a line "finished", when there is a newline character written. Otherwise the line could be read before it was fully written.

But my question is why he is waiting for new line even in multiline codec is information about xml end tag ???

The input is still a file and the multiline part is just a codec to the file input. Unfortunately I don't think there is another solution than adding a newline, for the file input to pick this up.

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