ELK+filebeat+kafka

复制代码
nohup ./filebeat -e -c filebeat.yml > filebeat.out &

tail -f filebeat.out

cd /etc/logstash/conf.d
vim kafka.conf


input {
  kafka {
    bootstrap_servers => "192.168.233.10:9092,192.168.233.20:9092,192.168.233.30:9092"
    topics => "nginx"
    type => "nginx_kafka"
    codec => "json"
    auto_offset_reset => "earliest"
    decorate_events => true
  }
}

output {
  if "nginx" in [tags] {
    elasticsearch {
       hosts => ["192.168.233.12:9200","192.168.233.13:9200"]
       index => "%{[fields][service_name]-%{+YYYY.MM.dd}}"
    }
  }
}

wq

codec => "json" 解析json格式的代码 auto_offset_reset => "earliest" 从头拉去,latest decorate_events => true 传递给es实例中的信息包含kafka的属性数据

test2

相关推荐
回家路上绕了弯1 天前
深入解析Agent Subagent架构:原理、协同逻辑与实战落地指南
分布式·后端
初次攀爬者1 天前
Kafka的Rebalance基础介绍
后端·kafka
初次攀爬者2 天前
Kafka + KRaft模式架构基础介绍
后端·kafka
初次攀爬者2 天前
Kafka + ZooKeeper架构基础介绍
后端·zookeeper·kafka
初次攀爬者2 天前
Kafka 基础介绍
spring boot·kafka·消息队列
DemonAvenger6 天前
Kafka性能调优:从参数配置到硬件选择的全方位指南
性能优化·kafka·消息队列
初次攀爬者6 天前
ZooKeeper 实现分布式锁的两种方式
分布式·后端·zookeeper
yumgpkpm8 天前
AI视频生成:Wan 2.2(阿里通义万相)在华为昇腾下的部署?
人工智能·hadoop·elasticsearch·zookeeper·flink·kafka·cloudera
昱宸星光8 天前
ELK日志收集平台搭建
elk