# Logstash Error - RuntimeError: entity expansion has grown too large

**URL:** <https://discuss.elastic.co/t/logstash-error-runtimeerror-entity-expansion-has-grown-too-large/273808>\
**Category:** Logstash\
**Created:** [May 24, 2021, 10:02am UTC](https://discuss.elastic.co/t/logstash-error-runtimeerror-entity-expansion-has-grown-too-large/273808 "2021-05-24T10:02:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rosanna\_Staiano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rosanna_staiano/32/83244_2.png) [@Rosanna\_Staiano](https://discuss.elastic.co/u/Rosanna_Staiano)\
**Post date:** [May 24, 2021, 10:02am UTC](https://discuss.elastic.co/t/logstash-error-runtimeerror-entity-expansion-has-grown-too-large/273808/1 "2021-05-24T10:02:02Z")

</div>

Hello,  
I've a lot of xml-file containing log events and some of them are pretty large.

I'm trying to parse them with Logstash, but when the xml is too large, I get an xmlparsefailure and I got this error:

`RuntimeError: entity expansion has grown too large.`

Have you any idea to what can I do to handle this?

Thank you!

---

<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 24, 2021, 2:43pm UTC](https://discuss.elastic.co/t/logstash-error-runtimeerror-entity-expansion-has-grown-too-large/273808/2 "2021-05-24T14:43:59Z")

</div>

> [@Rosanna\_Staiano](#):
>
> RuntimeError: entity expansion has grown too large.

The XML parser has a limit of 10 KB for the maximum size of an entity substitution. This was introduced to protect against [denial of service](https://www.ruby-lang.org/en/news/2013/02/22/rexml-dos-2013-02-22/) attacks.

The parser itself allow you to increase REXML::Document.entity\_expansion\_text\_limit, but logstash does not provide a way to set that.

---

<div class="post-metadata">

**Author:** ![Rosanna\_Staiano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rosanna_staiano/32/83244_2.png) [@Rosanna\_Staiano](https://discuss.elastic.co/u/Rosanna_Staiano)\
**Post date:** [May 24, 2021, 3:06pm UTC](https://discuss.elastic.co/t/logstash-error-runtimeerror-entity-expansion-has-grown-too-large/273808/3 "2021-05-24T15:06:07Z")

</div>

Thank you Badger!!

---

<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:** [June 21, 2021, 3:06pm UTC](https://discuss.elastic.co/t/logstash-error-runtimeerror-entity-expansion-has-grown-too-large/273808/4 "2021-06-21T15:06:53Z")

</div>

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