# Json parser error

**URL:** <https://discuss.elastic.co/t/json-parser-error/261061>\
**Category:** Logstash\
**Created:** [January 13, 2021, 10:05pm UTC](https://discuss.elastic.co/t/json-parser-error/261061 "2021-01-13T22:05:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Surjiths](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@Surjiths](https://discuss.elastic.co/u/Surjiths)\
**Post date:** [January 13, 2021, 10:05pm UTC](https://discuss.elastic.co/t/json-parser-error/261061/1 "2021-01-13T22:05:29Z")

</div>

```auto
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 ?

```

---

<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 10, 2021, 10:05pm UTC](https://discuss.elastic.co/t/json-parser-error/261061/2 "2021-02-10T22:05:38Z")

</div>

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