ELK学习二:filebeat收集
温馨提示:
本文最后更新于 2022年06月13日,已超过 957 天没有更新。若文章内的图片失效(无法正常加载),请留言反馈或直接联系我。
下载安装地址:
https://www.elastic.co/cn/downloads/beats/filebeat
配置filebeat
filebeat配置分为2个部分,input和output:
input:
filebeat.inputs:
# Each - is an input. Most options can be set at the input level, so
# you can use different inputs for various configurations.
# Below are the input specific configurations.
- type: log
# Change to true to enable this input configuration.
enabled: true
# Paths that should be crawled and fetched. Glob based paths.
paths:
- /var/log/*.log
- /www/wwwlogs/**
output:
output.kafka:
hosts: ["127.0.0.1:9092"]
# 在这里通过引用fields来指定目标topic
topic: 'test-input'
version: 0.11.0.0
compression: gzip
max_message_bytes: 1000000
注意,开启kafka output需要在modules.d/中将kafka.yml.disable改名为 kafka.yml
启动filebeat
./filebeat -e -c filebeat.yml -d "publish" # 直接启动查看启动日志
nohup ./filebeat -e -c filebeat.yml >/dev/null 2>&1 & # 后台方式启动
正文到此结束
- 本文标签: 服务架构
- 本文链接: https://www.php20.cn/article/377
- 版权声明: 本文由仙士可原创发布,转载请遵循《署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)》许可协议授权