Json parser error

Hi Team,
I am getting the following error from logstash

[2020-12-09T08:20:57.962Z][ERROR][logstash.codecs.json     ] JSON parse error, original data now in message field {:error=>#<LogStash::Json::ParserError: Unrecognized token 'Expected': was expecting ('true', 'false' or 'null')
 at [Source: (String)"Expected number of records for xxxx and model yyyy from abc database is 7759"; line: 1, column: 9]>, :data=>"Expected number of records for xxxx and model yyyy from abc database is 7759"}

Original message, which was generated from Java microservice through logback configuration

{"host":{"name":"localhost"},"level":"INFO","message":"Expected number of records for xxxx and model yyyy from abc database is 7759","level_value":20000,"thread_name":"main","@timestamp":"2020-12-09T08:20:57.962Z","logger_name":"com.kafka.writer.app.listener.DataWatcherImpl","tags":["kafka-writer","beats_input_codec_json_applied"],"log_source":{"file":{"path":"/u01/logging/kafka-writer-service/kafka-writer-2/logs/kafka-writer-log.log"},"offset":361}}


And this is the input part of logstash configuration

input {
  beats {
    port => 5044
    codec => "json" 
  }
}

Original message is in json format and I have it verified. Eventhough we are getting this json parser error, I could see that the message is getting passed through the later stages in filter and correctly passed to the output file. Could anybody pease help to understand , why we are getting parser error here ?

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