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
