处理的是nginx日志,场景是不同业务域名有一套独立的access.log和error.log,需求是通过filebeat采集后推送到不同的kafka,配置文件如下: filebeat.prospectors:-type:logenabled:truepaths:-/home/work/log/
处理的是nginx日志,场景是不同业务域名有一套独立的access.log和error.log,需求是通过filebeat采集后推送到不同的kafka,配置文件如下:
filebeat.prospectors: - type: log enabled: true paths: - /home/work/log/nginx/api.xmpush.xiaomi.com-access.log - /home/work/log/nginx/register.xmpush.xiaomi.com-access.log - /home/work/log/nginx/feedback.xmpush.xiaomi.com-access.log fields: ttopic: sre_xmpush_mt_api_nginx_access tail_files: true - type: log enabled: true paths: - /home/work/log/nginx/api.xmpush.xiaomi.com-error.log - /home/work/log/nginx/register.xmpush.xiaomi.com-error.log - /home/work/log/nginx/feedback.xmpush.xiaomi.com-error.log fields: ttopic: sre_xmpush_mt_api_nginx_error tail_files: true ....................... output.kafka: enabled: true hosts: ["1.1.1.1:6666","2.2.2.2:6666","3.3.3.3:6666","4.4.4.4:6666"] topic: '%{[fields][ttopic]}'
“运维网咖社”原创作品,允许转载,转载时请务必以超链接形式标明文章原始出处、作者信息和本声明。否则将追究法律责任。http://www.net-add.com
©本站文章(技术文章和tank手记)均为社长"矢量比特"工作.实践.学习中的心得原创或手记,请勿转载!
欢迎扫描关注微信公众号【运维网咖社】
社长"矢量比特",曾就职中软、新浪,现任职小米,致力于DevOps运维体系的探索和运维技术的研究实践. |