Closed mohitgargk closed 7 years ago
@suyograo @jsvd looking into the Kafka issue from https://discuss.elastic.co/t/logstash-kafka-avro-codec-error-with-doubles/79483 here (this one looks a little different, but the underlying issue in the forum post blocks this one too imo). Though it looks like the fix is rather going to be in the kafka plugin than here.
My schema file (user.avsc) is -
{"namespace": "example.avro", "type": "record", "name": "User", "fields": [ {"name": "name", "type": "string"}, {"name": "favorite_number", "type": ["int", "null"]}, {"name": "favorite_color", "type": ["string", "null"]} ] }
And logstash config file:
input { kafka { zk_connect => "localhost:2181" topic_id => "MemoryTest" type => "standard_event" group_id => "butiline_dash_prod" reset_beginning => true auto_offset_reset => smallest codec => { avro => { schema_uri => "/opt/ELK/logstash-1.5.4/bin/user.avsc" } } } } }
I am getting error on logstash console as:
Alyssa�blue {:exception=>#<NoMethodError: undefined method
decode' for ["avro", {"schema_uri"=>"/opt/ELK/logstash-1.5.4/bin/user.avsc"}]:Array>, :backtrace=>["/opt/ELK/logstash-1.5.4/vendor/bundle/jruby/1.9/gems/logstash-input-kafka-1.0.0/lib/logstash/inputs/kafka.rb:169:in
queue_event'", "/opt/ELK/logstash-1.5.4/vendor/bundle/jruby/1.9/gems/logstash-input-kafka-1.0.0/lib/logstash/inputs/kafka.rb:139:inrun'", "/opt/ELK/logstash-1.5.4/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.4-java/lib/logstash/pipeline.rb:177:in
inputworker'", "/opt/ELK/logstash-1.5.4/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.4-java/lib/logstash/pipeline.rb:171:in`start_input'"], :level=>:error}