Alex Guo
文章36
标签33
分类10
大数据日志分析系统边缘节点日志上传-flume,filbeat,logstash-forward

大数据日志分析系统边缘节点日志上传-flume,filbeat,logstash-forward

上传组件简介:

它们都是很好的资源上传工具,直接指定目录、文件就可以上传,通用功能不多说,区别除了与本公司产品兼容性好以外:

  • filebeat elastic(ELK)官网推荐:占用资源少
  • flume    apache官网产品:可定制性强
  • logstash-forward  已经过期的产品不多说。

因为需求简单,只是边缘节点日志上传最终选用了filebeat 

#正确格式原始日志示例:

1512231002.276     89 117.169.22.89 TCP_REFRESH_HIT/304 199 GET http://www.baidu.com/download/EF_patch_1.0.3.2-1.0.3.3.exe  - DIRECT/122.228.246.78 - "-" "Mozilla/5.0 Gecko/20100115 Firefox/3.6" "-"

#测试时追加日志的shell

echo '1512231002.276     89 117.169.22.89 TCP_REFRESH_HIT/304 199 GET http://www.baidu.com/download/EF_patch_1.0.3.2-1.0.3.3.exe  - DIRECT/122.228.246.78 - "-" "Mozilla/5.0 Gecko/20100115 Firefox/3.6" "-"'  >>  /data/cache1/filbeat_conf/logsdir/test.log

#filbeat配置示例:

[root@filbeathost filbeat_conf]# cat /data/cache1/filbeat_conf/filebeat-file-sp265055.yml
filebeat.prospectors:
- type: log
 paths:
   - /data/cache1/filbeat_conf/logsdir/* 
output.logstash:
 hosts: ["logstash-host1:5055","logstash-host2:5055","logstash-host3:5055","logstash-host4:5055","logstash-host5:5055"]

#启动

nohup filebeat -e -c /data/cache1/filbeat_conf/filebeat-file-sp265055.yml  -d "publish" &
本文作者:Alex Guo
本文链接:https://alexguo.net/2018/12/18/%E5%A4%A7%E6%95%B0%E6%8D%AE%E6%97%A5%E5%BF%97%E5%88%86%E6%9E%90%E7%B3%BB%E7%BB%9F-%E8%BE%B9%E7%BC%98%E8%8A%82%E7%82%B9%E6%97%A5%E5%BF%97%E4%B8%8A%E4%BC%A0-flume%EF%BC%8Cfilbeat-logstash-forward/
版权声明:本文采用 CC BY-NC-SA 3.0 CN 协议进行许可