# Json Codec dealing with NaN, Inf

**URL:** <https://discuss.elastic.co/t/json-codec-dealing-with-nan-inf/138611>\
**Category:** Logstash\
**Created:** [July 5, 2018, 12:32am UTC](https://discuss.elastic.co/t/json-codec-dealing-with-nan-inf/138611 "2018-07-05T00:32:33Z")\
**Posts on this page:** 5\
**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 5, 2018, 12:32am UTC](https://discuss.elastic.co/t/json-codec-dealing-with-nan-inf/138611/1 "2018-07-05T00:32:33Z")

</div>

Hello, I am trying to use the json codec to parse json files that have NaN and Inf as values; however, it doesn't work. I am getting the following error message:

[2018-07-04T17:03:36,005][ERROR][logstash.codecs.json] JSON parse error, original data now in message field {:error=\>#\<LogStash::Json::ParserError: Non-standard token 'NaN': enable JsonParser.Feature.ALLOW\_NON\_NUMERIC\_NUMBERS to allow

I'm not sure how to enable the feature through logstash, can anyone help me out on this?

---

<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 6, 2018, 6:31am UTC](https://discuss.elastic.co/t/json-codec-dealing-with-nan-inf/138611/2 "2018-07-06T06:31:58Z")

</div>

Does anyone have a solution for this? Thanks.

---

<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:31pm UTC](https://discuss.elastic.co/t/json-codec-dealing-with-nan-inf/138611/3 "2018-07-19T17:31:42Z")

</div>

Bump! How do I enable ALLOW\_NON\_NUMERIC\_NUMBERS in logstash's json codec???

---

<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 21, 2018, 5:12am UTC](https://discuss.elastic.co/t/json-codec-dealing-with-nan-inf/138611/4 "2018-07-21T05:12:05Z")

</div>

Bump

---

<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 18, 2018, 5:12am UTC](https://discuss.elastic.co/t/json-codec-dealing-with-nan-inf/138611/5 "2018-08-18T05:12:10Z")

</div>

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