Json_parse_exception


(Karthik S) #1

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/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


Logstash Jdbc input not updating last run
(system) #2

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