一、系统环境及软件版本
CentOS release 6.9 (Final)
java 1.8
logstash-6.6
filebeat 6.6
crontab
二、Filebeat部署
1)下载filebeat源码包
wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-6.6.0-linux-x86_64.tar.gz
2)解压源码包
tar xvf filebeat-6.6.0-linux-x86_64.tar.gz -C /usr/local/
mv /usr/local/filebeat-6.6.0-linux-x86_64/ /usr/local/filebeat
3)修改配置文件
vim /usr/local/filebeat/filebeat.yml
filebeat.inputs:
- type: log
# Change to true to enable this input configuration.
enabled: true
# 可以设置多个被抓取的目录
# 指定读取文件的位置
paths:
- /var/log/*.log
- /data/logs/rpc/shop-rpc/*.log
output.logstash:
# The Logstash hosts
hosts: ["10.3.2.4:12432"]
4)配置环境变量
vim /etc/profile.d/elk.sh
export PATH=$PATH:/usr/local/filebeat/
source /etc/profi