filebeat

filebeat 是go语言编写的轻量日志收集工具,建议和elk 其他组件版本保持一致

cat filebeat.yml
filebeat.inputs:
- type: log
enabled: true
paths:
# 日志文件路径
- /var/log/messages
fields:
# 搜集后日志的名字
type: host-message
- type: log
enabled: true
paths:
- /var/log/secure
fields:
type: host-secure
filebeat.config.modules:
path: ${path.config}/modules.d/*.yml
reload.enabled: false
setup.template.settings:
index.number_of_shards: 1
setup.kibana:
output.kafka:
hosts: ["101.43.43.9:9092"]
topic: '%{[fields.type]}'
required_acks: 1
compression: gzip
# 大于 max_message_bytes的事件将被丢弃。若要避免此问题,请确保 Filebeat 不会生成大max_message_bytes的事件。
max_message_bytes: 100000
#output.redis:
# hosts: ["127.0.0.1:6379"]
# key: "k8s-magedu-app1"
# db: 1
# timeout: 5
# password: "123456"

启动服务

filebeat -e -c /etc/filebeat/filebeat.yml \
-path.home /opt/filebeat \
-path.config /etc/filebeat \
-path.data /var/lib/filebeat \
-path.logs /var/log/filebeat &
Type Description Default Location Config Option
home Home of the Filebeat installation. path.home
bin The location for the binary files. {path.home}/bin
config The location for configuration files. {path.home} path.config
data The location for persistent data files. {path.home}/data path.data
logs The location for the logs created by Filebeat. {path.home}/logs path.logs
posted @   mingtian是吧  阅读(128)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· 葡萄城 AI 搜索升级:DeepSeek 加持,客户体验更智能
· 什么是nginx的强缓存和协商缓存
· 一文读懂知识蒸馏
点击右上角即可分享
微信分享提示