liveBook · Manning

YAML

As explained in Logs and Telemetry

YAML is a human-readable data serialization standard that represents structured data through indentation, mappings, and sequences.

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

How Logs and Telemetry covers it

How deep it goes
Works through runnable pipeline layouts, environment substitution, and multi-input/output sequences rather than YAML language internals.
Examples
Demonstrates dummy inputs routed to stdout, including Hello World and multi-input, multi-output configurations.
What it assumes
Assumes no YAML familiarity and points unfamiliar readers to specification, IDE, and formatter resources.
What you can do after
Operate/configure Fluent Bit pipelines in YAML and run them with the Fluent Bit configuration flag.
How it connects
Connects YAML configuration with Fluent Bit, Fluentd, Kubernetes, Carvel, processors, logs, metrics, and traces.

Also explained in

Compare how 16 books explain YAML →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Logs and Telemetry. The section links point to the parts of the book it draws on.