# I am getting "json\_parse\_exception"

**URL:** <https://discuss.elastic.co/t/i-am-getting-json-parse-exception/119991>\
**Category:** Elasticsearch\
**Created:** [February 15, 2018, 1:25pm UTC](https://discuss.elastic.co/t/i-am-getting-json-parse-exception/119991 "2018-02-15T13:25:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anilg](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@Anilg](https://discuss.elastic.co/u/Anilg)\
**Post date:** [February 15, 2018, 1:25pm UTC](https://discuss.elastic.co/t/i-am-getting-json-parse-exception/119991/1 "2018-02-15T13:25:35Z")

</div>

$ curl -H 'Content-Type: application/x-ndjson' -XPOST 'localhost:9200/\_bulk?pretty' --data-binary @satendra.log  
{  
"error" : {  
"root\_cause" : [  
{  
"type" : "json\_parse\_exception",  
"reason" : "Illegal character ((CTRL-CHAR, code 27)): only regular white space (\r, \n, \t) is allowed between tokens\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@1ed16062; line: 1, column: 2]"  
}  
],  
"type" : "json\_parse\_exception",  
"reason" : "Illegal character ((CTRL-CHAR, code 27)): only regular white space (\r, \n, \t) is allowed between tokens\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@1ed16062; line: 1, column: 2]"  
},  
"status" : 500  
}

can anyone tell me the reason and solution....please

---

<div class="post-metadata">

**Author:** ![colaci](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@colaci](https://discuss.elastic.co/u/colaci)\
**Post date:** [February 15, 2018, 1:28pm UTC](https://discuss.elastic.co/t/i-am-getting-json-parse-exception/119991/2 "2018-02-15T13:28:29Z")

</div>

Obviously you have a syntax error in your JSON. Show us the contents of satendra.log.

---

<div class="post-metadata">

**Author:** ![colaci](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@colaci](https://discuss.elastic.co/u/colaci)\
**Post date:** [February 15, 2018, 1:36pm UTC](https://discuss.elastic.co/t/i-am-getting-json-parse-exception/119991/4 "2018-02-15T13:36:37Z")

</div>

So why are you sending that log file to Elasticsearch? What is your intension?

P.S.  
There are some (possibly) private IP adresses, hostnames and emails in that log, I recommend you to edit your post and remove/redact them.

---

<div class="post-metadata">

**Author:** ![Anilg](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@Anilg](https://discuss.elastic.co/u/Anilg)\
**Post date:** [February 15, 2018, 1:42pm UTC](https://discuss.elastic.co/t/i-am-getting-json-parse-exception/119991/5 "2018-02-15T13:42:02Z")

</div>

Thank you Sir,

Actually I decided to remove once I get the solution but as per your suggestion I will remove it now.

I need to store all log files in ELASTIC SEARCH through logstash and then I need to see them in Kibana

as of now I dont have filebeat option. could you help to me

---

<div class="post-metadata">

**Author:** ![colaci](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@colaci](https://discuss.elastic.co/u/colaci)\
**Post date:** [February 15, 2018, 2:17pm UTC](https://discuss.elastic.co/t/i-am-getting-json-parse-exception/119991/6 "2018-02-15T14:17:20Z")

</div>

Make sure that the contents of the satendra.log is valid JSON. You can't just insert arbitrary contents. You have to format those contents in a key-value way using the JSON format. Please read the [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html).

---

<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:** [March 15, 2018, 2:25pm UTC](https://discuss.elastic.co/t/i-am-getting-json-parse-exception/119991/7 "2018-03-15T14:25:44Z")

</div>

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