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 &

Original: https://www.cnblogs.com/wangend/p/16364977.html
Author: mingtian是吧
Title: filebeat

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/577198/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球