首页 > 系统服务 > 详细

Linux----------filebeat

时间:2019-12-20 18:28:34      阅读:184      评论:0      收藏:0      [点我收藏+]

环境:
192.168.1.1 Kibana ES Logstash
192.168.1.2 Filebeat

一、下载二进制包

cd /data/soft/
rz filebeat-6.8.0-linux-x86_64.tar.gz

二、二进制安装

tar -xf filebeat-6.8.0-linux-x86_64.tar。gz
mv filebea-6.8.0 
cd filebeat/

三、配置filebeat发生日志到ES配置

vim /data/soft/filebeta-6.8.0/filebeat.yml
multiline.pattern: ^\[
multiline.negate: true
multiline.match: after
  paths:                            #收集的日志的路径
      - /var/log/messages.log       #系统日志
      - /data/logs/nginx.log        #应用日志
reload.enabled: true
reload.period: 10s
tags: ["service-log"]
#output.elasticsearch:
#  hosts: ["localhost:9200"]
output.logstash:
    hosts: ["192.168.1.1:9200"]     #指定logstash的ip

四、启动filebeat

前台启动:/data/soft/filebeat/filebeat  -e -c /data/soft//filebeat/filebeat.yml
后台启动:nohup /data/soft/filebeat/filebeat  -e -c /data/soft/filebeat/filebeat.yml >/data/logs/filebeat.log 2>&1 &

五、配置环境变量

echo 'export PATH=/data/soft/filebeat:$PATH' > /etc/profile.d/filebeat.sh
. /etc/profile.d/filebeta.sh
echo $PATH 

六、配置开启脚本

vim /etc/init.d/filebeat
#!/bin/bash

# chkconfig: 2345 90 10
# description: filebeat

FB_HOME=/usr/local/ELK/filebeat-5.6.3-linux-x86_64
case $1 in
        start) sudo -iu hadoop $FB_HOME/filebeat -c $FB_HOME/filebeat/filebeat.yml&;;
        *) echo "filebeat start" ;;
esac

chmod +X /etc/init.d/filebeat
chkconfig --add filebeat

Linux----------filebeat

原文:https://www.cnblogs.com/wangchengshi/p/12074512.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!