下载地址
https://www.elastic.co/cn/downloads/past-releases/filebeat-6-5-4
配置
vi filebeat.yml
输入
filebeat.inputs:
- type: log
enabled: true
paths:
- /var/log/*.log
输出到Logstash
output.elasticsearch:
hosts: ["192.168.1.42:9200"]
或者输出到 kafka
#-------------------------- Kafka output ------------------------------
output.kafka:
# Array of hosts to connect to.
hosts: ["127.0.0.1:9092"] #hosts是string数组类型,支持多个kafka实例地址(此处不是配置zookeeper地址)
topic: test #kafka的topic名称
配置 logstash的信息
output.logstash:
hosts: ["127.0.0.1:5044"]
关于多行日志的配置
java程序输出的日志多为多行,可参照如下配置
# 以`[`开头的为新的一条日志
multiline.pattern: '^\['
multiline.negate: true
multiline.match: after
multiline.timeout: 10s
multiline.max_lines: 2000
启动
./filebeat -e -c filebeat.yml -d "publish"
欢迎关注我的博客
http://www.toalaska.cn/articles/2019/05/07/1557235510247.html