Ingest xml file using Logstash

If you want to consume the entire file as a single event then you can do something like this.

If your file contains multiple XML documents you must consume them separately. If they all start with <control then your multiline codec should be

codec => multiline {
    pattern=>"^<control"
    negate => "true"
    what => "previous"
    auto_flush_interval => 1
    max_lines => 3000
}

If you want to parse the entire message then just use

xml { source => "message" store_xml => true target => "theXML" }

If you need specific elements from the document you can use the xpath option instead of setting store_xml.

The xml filter typically just works. The hard part is tweaking the multiline codec so that each event contains a complete XML document.