# Json\_parse\_exception

**URL:** <https://discuss.elastic.co/t/json-parse-exception/115640>\
**Category:** Logstash\
**Created:** [January 16, 2018, 6:19am UTC](https://discuss.elastic.co/t/json-parse-exception/115640 "2018-01-16T06:19:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![karthik\_s1](https://avatars.discourse-cdn.com/v4/letter/k/73ab20/32.png) [@karthik\_s1](https://discuss.elastic.co/u/karthik_s1)\
**Post date:** [January 16, 2018, 6:19am UTC](https://discuss.elastic.co/t/json-parse-exception/115640/1 "2018-01-16T06:19:44Z")

</div>

I am getting the following json\_parse\_exception while doing a bulk request from logstash to elasticsearch.

\_[ERROR][logstash.outputs.elasticsearch] Encountered a retryable error. Will Retry with exponential backoff {:code=\>500, :url=\>"[http://vpc-esalerts-43wktnne2aghqck7orxqw4zdmq.ap-southeast-1.es.amazonaws.com:80/](http://vpc-esalerts-43wktnne2aghqck7orxqw4zdmq.ap-southeast-1.es.amazonaws.com:80/)_bulk", :body=\>"{"error":{"root\_cause":[{"type":"json\_parse\_exception","reason":"Illegal character ((CTRL-CHAR, code 31)): only regular white space (\\r, \\n, \\t) is allowed between tokens\n at [Source: org.elasticsearch.common.bytes.BytesReference$MarkSupportingStreamInputWrapper@533254ff; line: 1, column: 2]"}],"type":"json\_parse\_exception","reason":"Illegal character ((CTRL-CHAR, code 31)): only regular white space (\\r, \\n, \\t) is allowed between tokens\n at [Source: org.elasticsearch.common.bytes.BytesReference$MarkSupportingStreamInputWrapper@533254ff; line: 1, column: 2]"},"status":500}"}_

I suspected that the data is leading to an invalid json, but it doesn't have any character which can affect the json. Following is the output i received in stdout:

{"group\_status":null,"channel":"P1DND","err\_code":"000","sms\_length":318,"units":3,"scheduled\_time":"0","attempt":0,"location\_id":0,"delivtime":1514358036,"campaign\_name":null,"total":1,"provider":null,"@version":"1","modified":1514358043,"id":120019261,"msg\_id":"008f87af-82f8-41c5-a8fd-1475c523d-1","smsc":"P1DND","custom\_id":"ec0260b2-a464-49e2-84ea-4156f89fbaab","mobile":"7878775791","sale\_price":0,"senttime":1514358012,"receivtime":1514358043,"@timestamp":"2018-01-16T05:42:01.119Z","senttime\_d":"27-12-2017 12:30:12","group\_id":20171227,"sender":"BULKSMS","fkuserid":"2033666447","unqid":"xxx-0-008f87af-82f8-41c5-a8fd-14fdb75c523d-1","provider\_id":0,"index\_date":"20171227","location":null,"channel\_id":9,"status":"DELIVRD"}

This is a valid json.

The data is being pulled from mysql with the help of jdbc input plugin. I had limited the sql query to 1 to make sure that other data is not causing any problem. So, with just one event in bulk request (that too a valid json string) its thowing the parse exception. Has it anything to do with delimiter set by the jdbc input plugin or the issue is entirely different?

Logstash version: 5.6  
Elasticsearch version: 6.0

---

<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:** [February 13, 2018, 6:20am UTC](https://discuss.elastic.co/t/json-parse-exception/115640/2 "2018-02-13T06:20:01Z")

</div>

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