Skills2026年4月14日·1 分钟阅读

Fluentd — Unified Logging Layer for Cloud-Native Infrastructure

Fluentd is a CNCF-graduated open-source data collector that unifies log collection and routing. With 1000+ plugins, it connects any source to any destination — the standard log layer for Kubernetes alongside Fluent Bit.

Agent 就绪

先审查再安装

这个资产需要先审查。复制的指令会要求 Agent dry-run、列出写入项,确认后再继续。

Needs Confirmation · 64/100策略:需确认
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
step-1.md
先审查命令
npx -y tokrepo@latest install 63e017ab-37c8-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run,确认写入项后再运行此命令。

TL;DR
Fluentd unifies log collection and routing with 1000+ plugins for any source and destination.
§01

What it is

Fluentd is a CNCF-graduated open-source data collector that unifies log collection and routing. With 1000+ community plugins, it connects any log source (files, syslog, Docker, Kubernetes) to any destination (Elasticsearch, S3, Datadog, Splunk). It is the standard log routing layer for Kubernetes alongside its lightweight sibling Fluent Bit.

Fluentd targets platform engineering and DevOps teams building centralized logging infrastructure. Instead of configuring each application to ship logs to a specific backend, you point everything at Fluentd and it routes logs based on tags and rules.

§02

Why it saves time or tokens

Without a unified log layer, each application configures its own log shipping: one uses a Datadog library, another writes to files, a third uses syslog. Fluentd standardizes collection so applications just write to stdout. Changing your log backend requires updating Fluentd config, not every application. When AI assistants generate logging configurations, targeting Fluentd produces portable configs that work with any backend.

§03

How to use

  1. Install Fluentd: gem install fluentd or use the official Docker image
  2. Create a fluent.conf with source, filter, and match directives
  3. Run Fluentd: fluentd -c fluent.conf
§04

Example

<source>
  @type tail
  path /var/log/app/*.log
  pos_file /var/log/fluentd/app.pos
  tag app.logs
  <parse>
    @type json
  </parse>
</source>

<filter app.logs>
  @type record_transformer
  <record>
    hostname "#{Socket.gethostname}"
  </record>
</filter>

<match app.logs>
  @type elasticsearch
  host elasticsearch.monitoring
  port 9200
  index_name app-logs
</match>
DirectivePurpose
sourceWhere logs come from
filterTransform log records
matchWhere logs are sent
labelGroup routing rules
bufferQueue before output
§05

Related on TokRepo

§06

Common pitfalls

  • Fluentd is Ruby-based and uses more memory than Fluent Bit; for resource-constrained environments (edge, sidecar), use Fluent Bit instead
  • Buffer overflow under high throughput causes log loss; configure persistent file-based buffers for production workloads
  • Plugin version compatibility issues can cause crashes; pin plugin versions and test upgrades in staging

常见问题

What is the difference between Fluentd and Fluent Bit?+

Fluentd is the full-featured log processor written in Ruby with 1000+ plugins. Fluent Bit is a lightweight, C-based log shipper with fewer plugins but much lower resource usage. Use Fluent Bit as the per-node log collector and Fluentd as the central aggregator. They use compatible protocols.

Does Fluentd work with Kubernetes?+

Yes. Fluentd is the standard Kubernetes log collector. Deploy it as a DaemonSet to collect container logs from each node. The Kubernetes metadata filter enriches logs with pod name, namespace, and labels. Fluentd is part of the CNCF ecosystem alongside Kubernetes.

What output destinations does Fluentd support?+

Fluentd supports Elasticsearch, Amazon S3, Google Cloud Logging, Datadog, Splunk, Kafka, PostgreSQL, MongoDB, and hundreds more through community plugins. You can output to multiple destinations simultaneously by defining multiple match directives.

How does Fluentd handle buffering?+

Fluentd buffers logs in memory or on disk before sending to outputs. File-based buffering prevents data loss during output failures. You configure buffer size, flush interval, and retry behavior. The buffer system handles backpressure when the output destination is slow or unavailable.

Is Fluentd production-ready?+

Yes. Fluentd is a CNCF graduated project, the highest maturity level. It is used in production by thousands of organizations worldwide. It handles billions of log events per day in large deployments. The project has active maintenance and a large community.

引用来源 (3)
  • Fluentd GitHub— Fluentd is a CNCF graduated data collector
  • Fluentd Docs— Fluentd configuration and plugin system
  • CNCF— CNCF graduated project maturity

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产