# XML parsing error: \<RuntimeError: entity expansion has grown too large\>

**URL:** <https://discuss.elastic.co/t/xml-parsing-error-runtimeerror-entity-expansion-has-grown-too-large/79104>\
**Category:** Logstash\
**Created:** [March 17, 2017, 11:30pm UTC](https://discuss.elastic.co/t/xml-parsing-error-runtimeerror-entity-expansion-has-grown-too-large/79104 "2017-03-17T23:30:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![daian.martinho](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@daian.martinho](https://discuss.elastic.co/u/daian.martinho)\
**Post date:** [March 17, 2017, 11:30pm UTC](https://discuss.elastic.co/t/xml-parsing-error-runtimeerror-entity-expansion-has-grown-too-large/79104/1 "2017-03-17T23:30:33Z")

</div>

I'm trying to parse XML file that has 40000 lines as one event.

Error at logstash:  
`<RuntimeError: entity expansion has grown too large>`

Filebeat:

```
  multiline.pattern: '^<?xml '
  multiline.match: after
  multiline.negate: true
  multiline.max_lines: 100000

```

Logstash:

```
       xml {
                    source => "message"
                    #store_xml => "false"
                    target => "xmldata"
# xpath => [
# "//Report/@name", "report_name",
# "//Policy/policyName", "policyName",
# "//ReportItem/description", "description"
# ]
                    #remove_namespaces => true
            }
            mutate {
                    remove_field => ["message"]
            }

```

Can i increase REXML limits?  
Am i doing something wrong?  
Can i have the same result in another way (large xml file as one event) ?

Tnks

> EDIT:  
> this machine has 32gb ram  
> I'v tried export LS\_HEAP\_SIZE=10g, without success  
> XML File has 2,5Mb

---

<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:** [April 14, 2017, 11:30pm UTC](https://discuss.elastic.co/t/xml-parsing-error-runtimeerror-entity-expansion-has-grown-too-large/79104/2 "2017-04-14T23:30:35Z")

</div>

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