# Trying to parse XML-logs

**URL:** <https://discuss.elastic.co/t/trying-to-parse-xml-logs/132749>\
**Category:** Logstash\
**Created:** [May 22, 2018, 8:26am UTC](https://discuss.elastic.co/t/trying-to-parse-xml-logs/132749 "2018-05-22T08:26:33Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [May 22, 2018, 12:23pm UTC](https://discuss.elastic.co/t/trying-to-parse-xml-logs/132749/2 "2018-05-22T12:23:17Z")

</div>

I would start with something like this:

```auto
input { 
    file { 
        path => "/somepath/somefile.xml" 
        codec => multiline { 
            pattern => "randomString" 
            negate => true 
            what => "previous" 
            auto_flush_interval => 2 
        }
        start_position => "beginning" 
        sincedb_path => "/dev/null" 
    } 
}
output { stdout { codec => rubydebug } }
filter {
    xml { 
        source => "message" 
        target => "theXML"
        store_xml => true 
    }
}

```

---

_[View the full topic](https://discuss.elastic.co/t/trying-to-parse-xml-logs/132749)._
