YAML is a human-readable way to express structured configuration. In Fluent Bit, it is the newer configuration form alongside the classic format, aligning configuration with common cloud-native and Kubernetes notation. YAML support began in Fluent Bit v1.9 and is considered production-ready from v2.0. section 2.2
A Fluent Bit YAML file organizes settings as mappings and sequences. Top-level service settings sit under service, while data flow is grouped under pipeline with plural inputs and outputs lists. Indentation is significant, so nested properties must remain consistently aligned. section 2.2.2
Hello World pipeline
A minimal YAML configuration defines an environment value, sets service flush and log level, then sends dummy events through pipeline.inputs to pipeline.outputs. The dummy input emits { "hello": "my world" }; the stdout output matches "*" and prints the events. Run it with fluent-bit -c hello-world.yaml. section 2.2.2
Table 2.5 Classic Fluent Bit vs. Fluent Bit YAML configuration
|
Classic Fluent Bit
|
Fluent Bit YAML (without Kubernetes idiomatic formatting)
|
|---|---|
# Hello World config will
# take events received on
# port 18080 using TCP as a protocol
[SERVICE]
flush 1
daemon Off
log_level info
# define the TCP source that will provide log events
[INPUT]
name Dummy
dummy {"hello":"my world"}
# Accept all log events regardless
# of tag and write them to the console
[OUTPUT]
name stdout
match *
|
# Hello World config will
# take events received on
# port 18080 using TCP as a protocol
service:
flush_interval: 1
log_level: info
pipeline:
inputs:
- name: dummy
dummy: '{ "hello": "my world" }'
tag: test
outputs:
- name: stdout
match: *
|
Compare the same dummy-to-stdout pipeline in classic and YAML forms. YAML adds an explicit pipeline level and uses input and output sequences rather than repeated directive blocks. section 2.2.2
YAML also supports configuration values through env and ${...} substitution, and its sequences make multiple inputs or outputs explicit. Some Fluent Bit capabilities are YAML-only: processors are configured only in YAML and can affect logs, metrics, or traces before buffering. section 2.2.2 section 9.2
Classic configuration remains supported for compatibility, but YAML is the direction for newer features. YAML tooling and templating can be used for configuration workflows, including tools that template YAML files. section 2.2















