Hello to everybody.
I am really noob on elastic stack and I am trying to import some json information with the HTTP input to Elasticsarch, but I recive a parse error:
exception=>#<LogStash::Json::ParserError: Unrecognized token 'json': was expecting ('true', 'false' or 'null')
This is how i recive the information on my elasticsearch:
"_type" : "_doc",
"_id" : "vCS44WsBBF5AknIKMFMZ",
"_score" : 1.0,
"_source" : {
"message" : """json={"id":"136030541","domain":"sdl","priority":"5.0","context":"my.alert.sdl.Error500","srcIp":"","dstIp":"","srcPort":"","dstPort":"","category":"my.context","protocol":"","username":"","application":"","status":"4","creation_date":"Thu Jul 11 15:47:52 UTC 2019","ack_status_date":null,"digest":"e738f645464be99ff223b504ec4a213d92ce8c6f","scaled":"false","srcHost":"","dstHost":"","extraData":"{\"clientIpAddress\":\"null\",\"timeTaken\":\"463\",\"protocol\":\"HTTP+1.1\",\"bytesTransferred\":\"677\",\"method\":\"POST\",\"cookie\":\"gaqfse5dpcm690jdh5ho1f00o2%3A-\",\"userAgent\":\"Mozilla%2F4.0+%28compatible%3B+MSIE+6.0%3B+Windows+NT+5.1%29\",\"referralUri\":\"http%3A%2F%2Fwww.logcasts.com%2Fcart.do%3Faction%3Dview%26itemId%3DLOG-56%26product_id%3D235-40ER0-J3308%26JSESSIONID%3DSD3SL2FF4ADFF4\",\"uri\":\"%2Fcategory.screen%3Fcategory_id%3DFURNITURE%26JSESSIONID%3DSD3SL2FF4ADFF4\",\"eventdate\":\"2019-07-11+11%3A56%3A57.04\",\"timestamp\":\"11%2FJul%2F2019%3A11%3A56%3A53+%2B0000\",\"statusCode\":\"500\"}","engine":"pilot.my.alert.samps.Error500","textMessage":"Error 500","shortMessage":"Error 500","alertname":"Error500","categoryname":"My Alerts","subcategoryname":"Personal"}""",
"headers" : {
"request_path" : "/",
"request_method" : "POST",
"http_accept" : null,
"content_length" : "1219",
"connection" : "Keep-Alive",
"http_user_agent" : "Apache-HttpClient/4.5.2 (Java/1.8.0_191)",
"http_host" : "XXXXXXXXXXXXXXX:8080",
"http_version" : "HTTP/1.1",
"content_type" : "application/x-www-form-urlencoded"
},
"host" : "XXXXXXXXXXXXX",
"@version" : "1",
"@timestamp" : "2019-07-11T15:47:52.855Z"
}
I want to parse the message field with this configuration:
filter {
json {
source => "message"
}
}
Could anyone help me with this? I think that could be the format of the message field, but i dont know how i could alter it.
Thanks to all.