0

Using logstash 5.0.0, Taking kafka source as the input -> taking the data and producing the output in Elasticsearch. (ElasticSearch version 5.0.0)

Logstash conf:

input{
kafka{
bootstrap_servers => "XXX.XXX.XX.XXX:9092","XXX.XXX.XX.XXX:9092","XXX.XXX.XX.XXX:9092"
topics => ["a-data","f-data","n-data"]
group_id => "sound"
auto_offset_reset => "earliest"
consumer_threads => 2
}
}
filter{
json{
source => "message"
}
}
output {
elasticsearch {
hosts => [ "XXX.XXX.XX.XXX:9200" ]
}
}

When I run the below configuration , i am getting this following error.

$ ./logstash -f sound.conf
Sending Logstash logs to /logstash-5.0.0/logs which is now configured vi   a log4j2.properties.
[2017-01-17T10:53:29,273][ERROR][logstash.agent           ] fetched an invalid c   onfig {:config=>"input{\nkafka{\nbootstrap_servers => \"XX.XXX.XXX.XX:9092\",\"XXX.XXX.XX.XXX:9092\",\"XXX.XXX.XX.XXX:9092\"\ntopics => [\"a-data\",\"f-data\   ",\"n-data\"]\ngroup_id => \"sound\"\nauto_offset_reset => \"earliest\"\nc   onsumer_threads => 2\n}\n}\nfilter{\njson{\nsource => \"message\"\n}\n}\noutput    {\nelasticsearch {\nhosts => [ \"XX.XX.XXX.XX:9200\" ]\n}\n}\n\n", :reason=>"Ex   pected one of #, {, } at line 3, column 40 (byte 54) after input{\nkafka{\nboots   trap_servers => \"XX.XX.XXX.XX:9092\""}

Can anyone help me with this configuration.

Soundarya Thiagarajan
  • 574
  • 2
  • 13
  • 31

1 Answers1

0

Shouldn't your topic be topics which is an array, where you've inserted the values as a hash:

topics => ["a-data","f-data","n-data"] <-- try changing this line
Kulasangar
  • 9,046
  • 5
  • 51
  • 82