ELFK(ES+LOGSTASH+FILEBEAT+KIBANA)

本文对比了四种常用的日志采集工具——Logstash、Filebeat、Fluentd和FluentBit。Logstash功能丰富但资源消耗大,依赖JDK;Filebeat轻量级,适合与ELK栈集成;Fluentd和FluentBit内存占用低,FluentBit插件较少。在选择时需根据场景和资源需求来决定。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

日志采集器选择

常见的日志采集工具:Logstash、Filebeat、Fluentd、Fluent Bit、Logagent、logtail、rsyslog、syslog-ng
我们对比其中常用的Logstash、Filebeat、Fluentd、Fluent Bit来进行选择

logstashfilebeatFluentdFluent Bit
scopecontainers/serverscontainers/serverscontainers/serverscontainers/servers
LanguageJrubyGolangC&RubyC
Memory~400MB~20MB~40MB~450KB
PerformanceHigh PerformanceHigh PerformanceHigh PerformanceHigh Performance
Dependenciesjdk零依赖,某些插件可能需要依赖依赖gem零依赖,某些插件可能需要依赖
Plugins1k+插件,功能丰富1k+插件,功能丰富650+插件可用大约35插件可用
LicenseElasticElasticApache License v2.0Apache License v2.0

logstash比较重量级,而且对jdk有强依赖,在做选型的时候,需要特别留意他的资源消耗,基本上可消耗内存在400M以上,cpu 达1G左右

配置:

input {
   file {
         path => ["/data/log/**/*.log"]       ###这里递归匹配目录及其子目录
         start_position=>"beginning"
    }

}

output {

    stdout {

         codec => rubydebug

    }

}

filebeat:

没有依赖,资源消耗相对比较少,但是场景比较受限,和ELK集成最佳

filebeat.inputs:

- type: log
  enabled: true
  paths:
   - /data/log/**/*.log
output.kafka:
   enable: true
   hosts: ["主机1:9092","主机2:9092","主机3:9092"]
   topic: "test_filebeat"

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值