# Handling Large XML Files

**URL:** <https://discuss.elastic.co/t/handling-large-xml-files/288068>\
**Category:** Logstash\
**Created:** [October 30, 2021, 6:09pm UTC](https://discuss.elastic.co/t/handling-large-xml-files/288068 "2021-10-30T18:09:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tim\_Mobley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tim_mobley/32/94741_2.png) [@Tim\_Mobley](https://discuss.elastic.co/u/Tim_Mobley)\
**Post date:** [October 30, 2021, 6:09pm UTC](https://discuss.elastic.co/t/handling-large-xml-files/288068/1 "2021-10-30T18:09:42Z")

</div>

I have a large XML file that I'm trying to parse. But when I use `max_lines` I somehow lose the `@timestamp` field. Is there a way to use both?

```auto
input {
  file {
    path => ["C:/temp/TEST/*.xml"]
    start_position => "beginning"    
    codec => multiline {
      pattern => "^ZsExDrC" 
      what => "previous" 
      negate => true 
      auto_flush_interval => 2
      # Problem: When 'max_line' is applied, @timestamp (and other fields) are stripped
      max_lines => 15000
    }
  }
}

```

---

<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:** [October 31, 2021, 11:54pm UTC](https://discuss.elastic.co/t/handling-large-xml-files/288068/2 "2021-10-31T23:54:03Z")

</div>

I have never seen that happen before, and I use multiline codecs a lot. Are you sure that is the only change you are making?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 28, 2021, 11:54pm UTC](https://discuss.elastic.co/t/handling-large-xml-files/288068/3 "2021-11-28T23:54:19Z")

</div>

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