liveBook · Manning

Content_modifier

As explained in Logs and Telemetry

content_modifier is a Fluent Bit processor that modifies fields or attributes in telemetry records.

content_modifier is a Fluent Bit processor for changing fields or attributes in telemetry records. It can apply multiple modifications within one processor configuration without serializing and deserializing the data between calls. section 9.2.2

Configure each modification with an action and key, adding value, pattern, or converted_type when required:

  • insert adds an element; upsert adds it when absent or replaces its existing value; delete removes the element. section 9.2.2
  • rename changes an element name; extract applies a regular expression and produces a key-value result. section 9.2.2
  • hash replaces an element with a hashed value; convert changes its type to string, boolean, int, or double. section 9.2.2

Modify a dummy log event

A dummy input inserts ImNew with the value cool value. Output processors then delete recipient, upsert message, rename noName to newName, and hash the renamed value. Stdout shows the resulting record with the inserted and updated fields. section 9.2.2

Listing 9.3 Trace-modifying configuration: processor-trace-modifier.yaml
pipeline:
  inputs:
    - name: opentelemetry
      listen: 127.0.0.1
      port: 4317
      processors:
        traces:                      #1
          - name: content_modifier
            action: upsert
            context: span_attributes          #2
            key: "BIGkey"           #3
            value: "Modified"       #3

Trace pipelines declare the processor under traces and specify a context such as span_attributes, span_name, span_kind, or span_status. section 9.2.3

How Logs and Telemetry covers it

How deep it goes
Explains action-specific keys, values, patterns, types, serialization behavior, and trace contexts through runnable configurations.
Examples
Uses dummy JSON events, chained field changes, an OpenTelemetry trace, and telemetrygen-generated input.
What it assumes
Assumes familiarity with Fluent Bit pipelines and telemetry records while demonstrating basic log and trace configurations.
What you can do after
Operate/configure Fluent Bit to insert, replace, delete, rename, extract, hash, or convert telemetry fields and attributes.
How it connects
Connects processors with logs, traces, OpenTelemetry Protocol, stdout output, and telemetrygen.

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.