# Doing a double split on json files

**URL:** <https://discuss.elastic.co/t/doing-a-double-split-on-json-files/140780>\
**Category:** Logstash\
**Created:** [July 19, 2018, 5:19pm UTC](https://discuss.elastic.co/t/doing-a-double-split-on-json-files/140780 "2018-07-19T17:19:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![alex3](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@alex3](https://discuss.elastic.co/u/alex3)\
**Post date:** [July 19, 2018, 5:19pm UTC](https://discuss.elastic.co/t/doing-a-double-split-on-json-files/140780/1 "2018-07-19T17:19:54Z")

</div>

So I have a nested list of object represented in a json format, where each json object contains a list I also want to split. When I had my codec as "json" in my file input, it would automatically split the json object and in my filter I would just split it by the second field. The only problem is that there are NaN/Infinity values that I want to gsub and replace with quoted NaNs and Infinity because JSON doesn't support parsing those. So I can't have json codec in my file input so I just apply the json codec inside the filter. The only problem is that once I do that I have to do a double split in my filter, but I noticed that this is REALLY slow compared to what I had before. Any ideas to help me?

---

<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:** [August 16, 2018, 5:20pm UTC](https://discuss.elastic.co/t/doing-a-double-split-on-json-files/140780/2 "2018-08-16T17:20:03Z")

</div>

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