一、filebeat安裝
filebeat-kafka版本適配
1、安裝包下載
https://www.elastic.co/cn/downloads/past-releases#filebeat
解壓
2、新建yml配置文件,如test.yml文章來源:http://www.zghlxwxcb.cn/news/detail-574332.html
filebeat.inputs:
- type: log
enabled: true
paths:
- /var/log/usermonitor/usermonitor.log
fields:
type: "usermonitor"
fields_under_root: true
exclude_files: [".gz$"]
- type: log
enabled: true
paths:
- /var/log/secure
fields:
type: "secure"
fields_under_root: true
exclude_files: [".gz$"]
- type: log
enabled: true
paths:
- /var/log/message*
fields:
type: "messages"
fields_under_root: true
exclude_files: [".gz$"]
max_procs: 1
max_bytes: 50000
name: "1.1.1.1"
output.kafka:
enabled: true
hosts: ["ip:9092","ip:9092","ip:9092"]
topic: "topic"
username: "username"
password: "password"
3、Filebeat啟動和停止
啟動:./filebeat -c test.yml
停止:kill -9 PID文章來源地址http://www.zghlxwxcb.cn/news/detail-574332.html
到了這里,關(guān)于filebeat采集日志數(shù)據(jù)到kafka(一)(filebeat->kafka->logstash->es)的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!