# Logstash Avro Kafka Codec issue

**URL:** <https://discuss.elastic.co/t/logstash-avro-kafka-codec-issue/217510>\
**Category:** Logstash\
**Created:** [February 2, 2020, 5:05am UTC](https://discuss.elastic.co/t/logstash-avro-kafka-codec-issue/217510 "2020-02-02T05:05:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nick11](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nick11/32/53553_2.png) [@Nick11](https://discuss.elastic.co/u/Nick11)\
**Post date:** [February 2, 2020, 5:05am UTC](https://discuss.elastic.co/t/logstash-avro-kafka-codec-issue/217510/1 "2020-02-02T05:05:13Z")

</div>

Hi all,

I am running a simple logstash pipeline to consume a message from a Kafka topic, which is in AVRO format and display it i on the stdout. I get all empty elements in the logstash output.

AVRO Schema (bestMatchingOutput.avsc)

```
{"namespace":"com.test.bestmatcher.avro","type":"record","name":"AvroBestMatchingOutput","fields":[{"name":"orgId","type":"string"},{"name":"userId","type":"string"},{"name":"matchId","type":"string"},{"name":"matcherVersion","type":"string"}]}

```

AVRO message in Kafka published through Kafka Avro console Producer. I can easily consume this message using Kafka Avro console consumer.

```
{"orgId":"xyz","userId":"1595abbd3c6a22883814","matchId":"296EAADC0149A00D7","matcherVersion":"2.0.3"}

```

Logstash template

```
    input{
        kafka {
        codec => avro {
            schema_uri => "/testing/samplemessages/bestMatchingOutput.avsc"
        }
        key_deserializer_class => "org.apache.kafka.common.serialization.ByteArrayDeserializer"
        value_deserializer_class => "org.apache.kafka.common.serialization.ByteArrayDeserializer"
        bootstrap_servers => "localhost:9092"
        topics => ["topic1","topic2","topic3","topic4","topic5"]         
        decorate_events => "true"
      }
    }
filter {}

output{
    stdout { 
          codec => rubydebug 
          }      
}

```

No matter what I do the logstash output is empty as shown below

```
{
            "matchId" => "",
             "orgId" => "",
            "userId" => "",
        "@timestamp" => 2020-02-02T04:59:28.366Z,
    "matcherVersion" => "",
          "@version" => "1"
}

```

Any help is greatly appreciated. I am truly stuck with this issues.

Thanks  
Nick

---

<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:** [March 1, 2020, 5:05am UTC](https://discuss.elastic.co/t/logstash-avro-kafka-codec-issue/217510/2 "2020-03-01T05:05:22Z")

</div>

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