有什么选择如何添加到logstash kafka输入多个kafka主题?我正在寻找动态解决方案,因为我的主题数量正在变化。
我的logstash配置看起来像:
input {
kafka {
bootstrap_servers => "localhost:9092"
topics => ["company0","company1","company2","company3","company4"]
}
}
output {
elasticsearch {
hosts => ["localhost:9200"]
index => "indextry"
workers => 1
}
}
在此解决方案中,我使用5个kafka主题,但在另一种情况下,我想使用20个主题。
有什么动态的解决方案,如何在这里添加kafka主题?
Logstash kafka输入支持使用topics_pattern
配置。
kafka {
bootstrap_servers => "localhost:9092"
topics_pattern => ["company.*"]
}
此配置将使用以“ company”开头的每个主题。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句