首页 > 代码库 > Logstash之四:logstash接收kafka数据

Logstash之四:logstash接收kafka数据

3、kafka+logstash整合
logstash1.5以后已经集成了对kafka的支持扩展,可以在conf配置中直接使用

vim /etc/logstash/conf.d/pay.conf

input {
kafka{
zk_connect => "your zookeeper address:2181"
group_id => "logstash"
topic_id => "pay-replicated"
reset_beginning => false
consumer_threads => 5
decorate_events => true
}
}
output {
# stdout{ codec=> rubydebug }
redis {
host => ["your redis address:6380"]
batch => true
key => "logstash-nginx-pay-replicated"
data_type => "list"
}
}

重启logstash
service logstash restart

Logstash之四:logstash接收kafka数据