Content Modifier
The content_modifier processor allows you to manipulate the messages, metadata/attributes and content of Logs and Traces.
Similar to the functionality exposed by filters, this processor presents a unified mechanism to perform such operations for data manipulation. The most significant difference is that processors perform better than filters, and when chaining them, there are no encoding/decoding performance penalties.
Note that processors and this specific component can only be enabled using the new YAML configuration format. Classic mode configuration format doesn't support processors.
Contexts
The processor, works on top of what we call a context, meaning the place where the content modification will happen. We provide different contexts to manipulate the desired information, the following contexts are available:
OpenTelemetry Contexts
In addition, we provide special contexts to operate on data that follows an OpenTelemetry Log Schema, all of them operates on shared data across a group of records:
TIP: if your data is not following the OpenTelemetry Log Schema and your backend or destination for your logs expects to be in an OpenTelemetry schema, take a look at the processor called OpenTelemetry Envelope that you can use in conjunbction with this processor to transform your data to be compatible with OpenTelemetry Log schema.
Configuration Parameters
Actions
The actions specify the type of operation to run on top of a specific key or content from a Log or a Trace. The following actions are available:
Insert example
The following example appends the key color
with the value blue
to the log stream.
Upsert example
Update the value of key1
and insert key2
:
Delete example
Delete key2
from the stream:
Rename example
Change the name of key2
to test
:
Hash example
Apply the SHA-256 algorithm for the value of the key password
:
Extract example
By using a domain address, perform a extraction of the components of it as a list of key value pairs:
Convert example
Both keys in the example are strings. Convert the key1
to a double/float type and key2
to a boolean:
Last updated