# Decode kafka message

**URL:** https://discuss.elastic.co/t/decode-kafka-message/259355
**Category:** Logstash
**Created:** [December 22, 2020, 9:47am UTC](https://discuss.elastic.co/t/decode-kafka-message/259355 "2020-12-22T09:47:13Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![lstoneir](https://avatars.discourse-cdn.com/v4/letter/l/b9bd4f/32.png) [@lstoneir](https://discuss.elastic.co/u/lstoneir)
#### Post date: [December 22, 2020, 9:47am UTC](https://discuss.elastic.co/t/decode-kafka-message/259355/1 "2020-12-22T09:47:13Z")

</div>

Hi there i have a logstash config like this:

```auto
input{
    kafka
    {
            bootstrap_servers => "localhost:9092"
            topics => ["xx"]
            client_id => "v1"
            group_id => "v1-g"
    }
}
output {
  elasticsearch {
    hosts => ["localhost:9200"]
    id => "1"
    index => "xx"
    user => ""
    password => ""
  }
}

```

when i check my index, i see this mapping in my index:

```auto
@timestamp: -------
message: "---"

```

my data is JSON like:

```auto
{
    "bss": 502,
   "psw": 40,
   "time": "2020-12-15T12:12:12",
   "name": "no name"
}

```

how can i decode message of kafka (without avro) and import that message to index, not kafka's whole data !

---

<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: [January 19, 2021, 9:47am UTC](https://discuss.elastic.co/t/decode-kafka-message/259355/2 "2021-01-19T09:47:21Z")

</div>

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