# Indexing logs in json format

**URL:** <https://discuss.elastic.co/t/indexing-logs-in-json-format/102072>\
**Category:** Logstash\
**Created:** [September 28, 2017, 7:29am UTC](https://discuss.elastic.co/t/indexing-logs-in-json-format/102072 "2017-09-28T07:29:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![daaakeee](https://avatars.discourse-cdn.com/v4/letter/d/dbc845/32.png) [@daaakeee](https://discuss.elastic.co/u/daaakeee)\
**Post date:** [September 28, 2017, 7:29am UTC](https://discuss.elastic.co/t/indexing-logs-in-json-format/102072/1 "2017-09-28T07:29:08Z")

</div>

Hi guys! I am trying to index log in json format:

> `{"interests": "dota", "car": null, "surname": "Zhussipnazar", "name": "Daulet", "age": 20}`

But it gives me error, `_jsonparsefailure` , because logstash cant handle value 'null'  
How can I handle null value in json?

my config

> file {  
> path =\> "/var/log/test.log"  
> sincedb\_path =\> "/dev/null"  
> codec =\> "json"  
> }  
> filter {  
> json {  
> source =\> "message"  
> }  
> }  
> output {  
> stdout {  
> codec =\> rubydebug  
> }  
> }

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [September 28, 2017, 1:34pm UTC](https://discuss.elastic.co/t/indexing-logs-in-json-format/102072/2 "2017-09-28T13:34:01Z")

</div>

Is the null value really what trips up Logstash? What's the exact error message (use copy/paste)?

---

<div class="post-metadata">

**Author:** ![daaakeee](https://avatars.discourse-cdn.com/v4/letter/d/dbc845/32.png) [@daaakeee](https://discuss.elastic.co/u/daaakeee)\
**Post date:** [September 29, 2017, 3:40am UTC](https://discuss.elastic.co/t/indexing-logs-in-json-format/102072/3 "2017-09-29T03:40:15Z")

</div>

> [@daaakeee](#):
>
> \_jsonparsefailure

sorry, the fail was on the new line after each log, thank for your reply

---

<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:** [October 27, 2017, 3:40am UTC](https://discuss.elastic.co/t/indexing-logs-in-json-format/102072/4 "2017-10-27T03:40:30Z")

</div>

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