liveBook · Manning

Nest filter

As explained in Logs and Telemetry

A nest filter is a Fluent Bit filter that groups matching record elements into a nested object or promotes nested elements to their parent.

A nest filter reshapes Fluent Bit records by grouping matching attributes under a nested object or promoting nested elements to their parent. Use operation nest to demote attributes and lift to promote them. section 7.3

Configure the transformation around the target attributes and their destination:

  • Select attributes with wildcard; the wildcard is supported only as a postfix. section 7.3.1
  • Set nest_under to name the parent object receiving demoted attributes. section 7.3.1
  • Use remove_prefix to eliminate redundant common prefixes while grouping related attributes. section 7.3.1
  • Set nested_under to identify the object whose children should be promoted, and add_prefix when lifted elements need a prefix. section 7.3.1

Group or flatten record attributes

Use demotion to group Kubernetes metadata or other related attributes beneath a named object. Use promotion to flatten an unnecessarily complex hierarchy; the example also demonstrates promoting only path child elements. Console output can be parsed with a JSON beautifier. section 7.3.1

fluent-bit -c fluentbit/nest-example.conf.

Run the supplied Fluent Bit configuration to inspect nest and lift behavior with a dummy-input-created JSON payload. section 7.3.1

How Logs and Telemetry covers it

How deep it goes
Explains demotion, promotion, wildcard selection, parent naming, and prefix handling through a runnable JSON example.
Examples
Demonstrates Kubernetes metadata grouping, hierarchy flattening, dummy JSON input, console output, and selective path-element promotion.
What you can do after
Apply it via Fluent Bit configuration to group matching attributes or promote nested elements in event payloads.
How it connects
Connects event filtering with Kubernetes metadata, wildcard matching, prefixes, and nested object hierarchies.

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.