Add Fields
Overview
The Add Fields processor adds new fields to incoming telemetry records. It can be used to enrich logs with static values before the data is forwarded downstream.
Supported types: Logs
Configuration
| Parameter | Type | Default | Required | Description |
|---|---|---|---|---|
| ottl_expression | string | none | No | OTTL expression used to conditionally apply the field additions. |
Rules
When building the ottl_expression, the UI exposes rule-based conditions.
Attributes
| Parameter | Type | Description |
|---|---|---|
| Attribute Key | string | The attribute key to evaluate. Supported values: attribute; resource; log; span; metric (fields: aggregation_temporality; description; is_monotonic; name; type; unit); datapoint (fields: count; negative.offset; positive.offset; scale; sum; value_double; value_int; zero_count) |
| Operator | string | The operator to use for comparison. Supported values: equals; not equals; starts with; ends with; contains; regex; ==; !=; <; >; >=; <=; is boolean; is integer; is double; is map; is string; exists; not exists |
| Value | string | The value to compare against |
Note: Multiple rules can be combined in the UI using logical operators such as
ANDorOR, and the resulting rule set is converted into the finalottl_expression.
Fields To Add/Modify
Each item in fields defines one field operation to apply.
| Parameter | Type | Default | Required | Description |
|---|---|---|---|---|
| field_type | string | body | Yes | Target area where the field should be added or modified. Supported values: body attribute resource. |
| action | string | upsert | Yes | Operation to apply to the target field. Supported values: insert update upsert. |
| field | string | none | Yes | Field key or path to add or modify. |
| value | string | none | Yes | Value assigned to the target field. |
Example Configuration
{
"ottl_expression": "", // default: none
"fields": [
// required
{
"field_type": "body", // required, default: "body"
"action": "upsert", // required, default: "upsert"
"field": "", // required, default: none
"value": "", // required, default: none
},
],
}