# Logstash not parsing json from kafka

**URL:** https://discuss.elastic.co/t/logstash-not-parsing-json-from-kafka/182728
**Category:** Logstash
**Created:** [May 24, 2019, 9:24pm UTC](https://discuss.elastic.co/t/logstash-not-parsing-json-from-kafka/182728 "2019-05-24T21:24:41Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![ramzey1981](https://avatars.discourse-cdn.com/v4/letter/r/d26b3c/32.png) [@ramzey1981](https://discuss.elastic.co/u/ramzey1981)
#### Post date: [May 24, 2019, 9:24pm UTC](https://discuss.elastic.co/t/logstash-not-parsing-json-from-kafka/182728/1 "2019-05-24T21:24:42Z")

</div>

I have the below json message coming into logstash and entering with format indicated below into elasticsearch but unparsed even though i am using the json code. Please let me know if I'm missing something.

thanks

coming into logstash

```auto
"message" => "{ \"timestamp\": \"1558622557.826\", \"chain_id\": \"-\", \"message\": \"GET /service/event/status HTTP/1.1\", \"x-forwarded-for\": \"-\", \"x-forwarded-host\": \"-\", \"request\": { \"x_physiq_timespan\": \"-\", \"addr\": \"10.11.26.1\", \"user\": \"-\", \"size\": 152, \"method\": \"GET\", \"encoding\": \"-\", \"resource\": \"/service/event/status\", \"referrer\": \"-\", \"agent\": \"kube-probe/1.11+\" },\"response\": { \"size\": 296, \"status\": 200, \"time\": 0.007 }}"

```

Entering into elasticsearch

```auto
{ "timestamp": "1558647226.135", "chain_id": "-", "message": "GET /service/event/status HTTP/1.1", "x-forwarded-for": "-", "x-forwarded-host": "-", "request": { "x_physiq_timespan": "-", "addr": "10.11.42.1", "user": "-", "size": 153, "method": "GET", "encoding": "-", "resource": "/service/event/status", "referrer": "-", "agent": "kube-probe/1.11+" },"response": { "size": 296, "status": 200, "time": 0.006 }}

```

and the following codec I'm using for logstash

```auto
input {
  kafka {
    bootstrap_servers => "kafka-0.kafka-svc.logging:9092"
    codec => "json"
    topics => "logstash"
    auto_offset_reset => "earliest"
    decorate_events => true
  }
}

```

---

<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: [June 21, 2019, 9:24pm UTC](https://discuss.elastic.co/t/logstash-not-parsing-json-from-kafka/182728/2 "2019-06-21T21:24:54Z")

</div>

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