Filebeat输出Kafka配置

filebeat启动

  1. 前台启动:
bash 复制代码
/usr/local/fb/filebeat -e -c /usr/local/fb/filebeat.yml
  1. 后台启动:
bash 复制代码
nohup /usr/local/fb/filebeat -e -c /usr/local/fb/filebeat.yml > /dev/null 2>&1 &

input 配置 && output配置

  1. input配置
yaml 复制代码
- type: log
  enabled: true
  paths:
    - /var/fb/log/pe.log
  fields:
    topic: "wlinfo"
  json.keys_under_root: true
  json.overwrite_keys: true
  1. output配置
yaml 复制代码
output.kafka:
  hosts: ["192.168.110.49:9092"]
  topic: '%{[fields.topic]}'
  required_acks: 1
  compression: gzip
  max_message_bytes: 1000000
  max_retry: 3
  timeout: 30s
  1. 启动校验
    使用 filebeat test config 和 filebeat test output 命令验证配置,确保事件结构正确。可以先用 filebeat test config 看看是否能通过配置检查。
相关推荐
敖正炀4 小时前
高并发系统的降级预案与容错策略
分布式·架构
敖正炀4 小时前
稳定性监控与告警体系:SLI/SLO/SLA 实践
分布式·架构
敖正炀4 小时前
故障演练与混沌工程:ChaosBlade 到 Litmus
分布式·架构
敖正炀5 小时前
全链路压测与容量规划方法论
分布式·架构
敖正炀5 小时前
限流算法深度与 Guava/Sentinel 源码:从单机令牌桶到分布式滑动窗口的流量防护体系
分布式·架构
山屿落星辰9 小时前
hixl - 让分布式训练“零拷贝“通信
分布式
逍遥德11 小时前
SpringBoot自带TaskScheduler 接口使用详解:(02)微服务多实例模式下,爆发任务重复执行问题
spring boot·分布式·后端·微服务·中间件
Devin~Y11 小时前
互联网大厂 Java 面试实录:JVM、Spring Boot、MyBatis、Redis、Kafka、Spring AI、K8s 全链路追问小Y
java·jvm·spring boot·redis·kafka·mybatis·spring security
倒流时光三十年12 小时前
第12篇 Rebalance 深度解析
spring boot·kafka
Solis程序员12 小时前
基于 Outbox 事务表 + Canal 监听+kafka+多级缓存:高并发社交关注系统全链路架构设计
分布式·kafka·linq