mirror of
https://github.com/elastic/logstash.git
synced 2025-04-23 22:27:21 -04:00
parent
4683e51e4b
commit
cff7c37603
2 changed files with 5 additions and 2 deletions
|
@ -56,7 +56,8 @@ class LogStash::Inputs::Kafka < LogStash::Inputs::Base
|
|||
config :consumer_restart_on_error, :validate => :boolean, :default => true
|
||||
# Time in millis to wait for consumer to restart after an error
|
||||
config :consumer_restart_sleep_ms, :validate => :number, :default => 0
|
||||
config :decorate_events, :validate => :boolean, :default => true
|
||||
# Option to add Kafka metadata like topic, message size to the event
|
||||
config :decorate_events, :validate => :boolean, :default => false
|
||||
# A unique id for the consumer; generated automatically if not set.
|
||||
config :consumer_id, :validate => :string, :default => nil
|
||||
# The number of byes of messages to attempt to fetch for each topic-partition in each fetch
|
||||
|
|
|
@ -50,6 +50,8 @@ describe LogStash::Inputs::Kafka do
|
|||
kafka.run logstash_queue
|
||||
e = logstash_queue.pop
|
||||
insist { e["message"] } == "Kafka message"
|
||||
insist { e["kafka"] } == {"msg_size"=>13, "topic"=>"test", "consumer_group"=>"logstash"}
|
||||
# no metadata by default
|
||||
insist { e["kafka"] } == nil
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue