ELK-第二集

收集nginx日志和系统日志写入kafka,在用logstash读取出来写到elasticsearch


###node1 把nginx日志写到kafka里面 [root@node1 conf.d]# vim /etc/logstash/conf.d/nginx.conf input{ file { path => "/var/log/nginx/access.log" type => "nginx-access-log-1105" start_position => "beginning" stat_interval => "2" codec => "json" } } output { if [type] == "nginx-access-log-1105" { kafka { bootstrap_servers => "192.168.1.106:9092" topic_id => "nginx-accesslog-1105" codec => "json" } }

猜你喜欢

转载自www.cnblogs.com/zhaobin-diray/p/9126024.html
今日推荐