一、filebeat安装
filebeat-kafka版本适配
1、安装包下载
https://www.elastic.co/cn/downloads/past-releases#filebeat
解压
2、新建yml配置文件,如test.yml文章来源:https://www.toymoban.com/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文章来源地址https://www.toymoban.com/news/detail-574332.html
到了这里,关于filebeat采集日志数据到kafka(一)(filebeat->kafka->logstash->es)的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!