Logstash XML file

(Yirou) #1

I need to parse XML file and send content to EL. It's work for XML input without space before xml tag like that :
<?xml version="1.0" encoding="utf-8"?>
but when file have space bebore XML tag,
eg: SPACE<?xml version="1.0" encoding="utf-8"?>
Logstash don't send any data. I know that i should write a pattern to remove space. I use strip without success.
this is my pattern:
codec => multiline {
pattern => "^<?file .*>"
negate => "true"
what => "previous"
auto_flush_interval => 5

Thanks for help

(Yirou) #2

I found solution. I use gsub to remove space
gsub => ["message","SPACE<?xml version="1.0" encoding="utf-8"?>",""]


(system) #3

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