# Which (json or xml) input is better for parsing in logstash in terms of scalibility , performance and nested structure?

**URL:** <https://discuss.elastic.co/t/which-json-or-xml-input-is-better-for-parsing-in-logstash-in-terms-of-scalibility-performance-and-nested-structure/253555>\
**Category:** Logstash\
**Created:** [October 28, 2020, 10:57am UTC](https://discuss.elastic.co/t/which-json-or-xml-input-is-better-for-parsing-in-logstash-in-terms-of-scalibility-performance-and-nested-structure/253555 "2020-10-28T10:57:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abdul\_Gaffar\_Shaikh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abdul_gaffar_shaikh/32/78006_2.png) [@Abdul\_Gaffar\_Shaikh](https://discuss.elastic.co/u/Abdul_Gaffar_Shaikh)\
**Post date:** [October 28, 2020, 10:57am UTC](https://discuss.elastic.co/t/which-json-or-xml-input-is-better-for-parsing-in-logstash-in-terms-of-scalibility-performance-and-nested-structure/253555/1 "2020-10-28T10:57:52Z")

</div>

hi everyone ,

i need to decide which input type to parse in logstash for performance, scalibility and nested structure ?  
the input file could be nearly 100k records in size  
the data source is informatica.

please let me know in case of any info.

---

<div class="post-metadata">

**Author:** ![Wolfram\_Haussig](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wolfram_haussig/32/70528_2.png) [@Wolfram\_Haussig](https://discuss.elastic.co/u/Wolfram_Haussig)\
**Post date:** [October 28, 2020, 11:34am UTC](https://discuss.elastic.co/t/which-json-or-xml-input-is-better-for-parsing-in-logstash-in-terms-of-scalibility-performance-and-nested-structure/253555/2 "2020-10-28T11:34:56Z")

</div>

HI,

If you are able to use JSON then do that. XML has multiple drawbacks like:

- larger documents than JSON
- does not support Arrays
- vulnerabilities like external XML entities

I also think that parsing JSON is faster than XML but that might depend on your data. If you want to be sure test it yourself.

Best regards  
Wolfram

---

<div class="post-metadata">

**Author:** ![Abdul\_Gaffar\_Shaikh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abdul_gaffar_shaikh/32/78006_2.png) [@Abdul\_Gaffar\_Shaikh](https://discuss.elastic.co/u/Abdul_Gaffar_Shaikh)\
**Post date:** [October 28, 2020, 2:21pm UTC](https://discuss.elastic.co/t/which-json-or-xml-input-is-better-for-parsing-in-logstash-in-terms-of-scalibility-performance-and-nested-structure/253555/3 "2020-10-28T14:21:46Z")

</div>

ok thanks @Wolfram_Haussig🙂

my initial data looks like below :-

```
<metadata .....>
<total_doc_processed></total_doc_processed>
     <main_field>
    			<main_sub_field>
    			<field1></field1>
    			<field2></field2>
    			<field3></field3>
    			<field4></field4>
    			<field5></field5>
    			<field6></field6>
    			<field7></field7>
    			<field8></field8>
    			</main_sub_field>
    			<main_sub_field>
    			<field1></field1>
    			<field2></field2>
    			<field3></field3>
    			<field4></field4>
    			<field5></field5>
    			<field6></field6>
    			<field7></field7>
    			<field8></field8>
    			</main_sub_field>
        ....
        ....
    </main_field>
</metadata>

```

each main\_sub\_field will be a record in elasticsearch.....

---

<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 25, 2020, 2:21pm UTC](https://discuss.elastic.co/t/which-json-or-xml-input-is-better-for-parsing-in-logstash-in-terms-of-scalibility-performance-and-nested-structure/253555/4 "2020-11-25T14:21:47Z")

</div>

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