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
时间: 2024-10-24 16:01:32