Logstash issue with json_formater [LogStash::Json::ParserError: Unexpected character ('-' (code 45)): was expecting comma to separate ARRAY entries] -


i have issue converting value through logstash, can't find solution it. seems linked date.

#log line [2017-08-15 12:30:17] api.info: {"sessionid":"a216925---ff5992be7520924ff25992be75209c7","action":"processed","time":1502789417,"type":"bookingprocess","page":"order"} [] [] 

logstash configuration

filter {         if [type] == "api-prod-log" {                 grok {                         match => {"message" => "\[%{timestamp_iso8601:timestamp}\] %{word:module}.%{word:level}: (?<log_message>.*) \[\] \[\]" }                         add_field => [ "received_from", "%{host}" ]                 }                 json {                     source => "log_message"                     target => "flightsearchrequest"                     remove_field=>["log_message"]                 }                 date {                         match => [ "timestamp", "yyyy-mm-dd hh:mm:ss" ]                         timezone => "asia/jerusalem"                 }         } } 

any idea ?

thanks

what version of logstash using? on logstash 5.2.2 following logstash config:

input {     stdin{} }  filter {     grok {         match => {"message" => '\[%{timestamp_iso8601:timestamp}\] %{word:module}.%{word:level}: (?<log_message>.*) \[\] \[\]' }     }     json {         source => "log_message"         target => "flightsearchrequest"         remove_field=>["log_message"]     }     date {         match => [ "timestamp", "yyyy-mm-dd hh:mm:ss" ]         timezone => "asia/jerusalem"     } }  output{     stdout {codec => "rubydebug"} } 

i correct result , no errors, when pass log line input:

{              "@timestamp" => 2017-08-15t09:30:17.000z,     "flightsearchrequest" => {            "action" => "processed",         "sessionid" => "a216925---ff5992be7520924ff25992be75209c7",              "time" => 1502789417,              "page" => "order",              "type" => "bookingprocess"     },                   "level" => "info",                  "module" => "api",                "@version" => "1",                 "message" => "[2017-08-15 12:30:17] api.info: {\"sessionid\":\"a216925---ff5992be7520924ff25992be75209c7\",\"action\":\"processed\",\"time\":1502789417,\"type\":\"bookingprocess\",\"page\":\"order\"} [] []",               "timestamp" => "2017-08-15 12:30:17" } 

i've removed check "type" in beginning, can test if can affect result?


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -