Unable to Parse AVRO using Kafka Input and Avro Codec

Hi,

I am trying to use Kafka Input and Codec Avro, to read the messages but unable to do so.

In Kafka,

{
  "id": 5839355690199358000,
  "name": "VOH*a|[RF6y?"
}

In Logstash Output:

    "@timestamp" => 2022-10-08T14:16:12.907374Z,
         "event" => {
        "original" => "\u0000\u0000\u0000\u0000\u0002������lj�\u0001\u0018VOH*a|[RF6y?"
    },
      "@version" => "1",
      "document" => {
          "id" => 0,
        "name" => ""
    }
}

Current Logstash Configuration:

input {
  kafka {
    bootstrap_servers => "localhost:9092"
    topics => ["avro-schema-codec"]
    codec => avro {
        schema_uri => "/Users/Smit/Desktop/logstash-8.4.3/config/avro_schema.avsc"
        target => "[document]"

    }
  }
}

filter { }

output {
   stdout {  }
}

Schema AVSC File:

{
	"type": "record",
	"name": "MyRecord",
	"namespace": "com.mycompany",
	"fields": [
		{
			"name": "id",
			"type": "long"
		},
		{
			"name": "name",
			"type": "string"
		}
	]
}

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