For the complete documentation index, see llms.txt. This page is also available as Markdown.

Slice to Map

Turns a slice (array) into a map keyed by a field from each element, so you can address entries by name instead of position. Optionally use another field as the value; otherwise the whole element becomes the value.

Supported Telemetry Types

Logs
Metrics
Traces

Choose Telemetry Type picks one signal per processor instance. Add another instance to handle a second signal.

Configuration

Basic Configuration

Bindplane docs - Slice to Map - image 1

When to apply

Parameter
Type
Required
Default
Description

Choose Telemetry Type

Telemetry Selector

Yes

Logs

The signal this instance runs on: Logs, Metrics, or Traces (one at a time).

Condition

OTTL Condition

No

(empty)

Convert only the records that match. A guard like body["Event"]["EventData"]["Data"] != nil skips records without the array.

Source and target fields

Parameter
Type
Required
Default
Description

Source Field Type

Enum: Resource, Attribute, Body, Custom

Yes

Attribute

Where the source slice is read from. Body is logs-only. Custom takes any OTTL path.

Source Field

OTTL Field

Yes *

The field holding the slice (array). Bracket notation for nested fields. For a Body source, leave empty to use the whole body.

Target Field Type

Enum: Resource, Attribute, Body, Custom

Yes

Attribute

Where the resulting map is written. Body is logs-only.

Target Field

OTTL Field

Yes *

Destination for the resulting map. For a Body target, leave empty to use the whole body.

* The Body field type is the exception: it's optional, and leaving it empty targets the entire body.

Body is available for Logs only. For Metrics and Traces, the field type options are Resource, Attribute, and Custom.

Key and value

Parameter
Type
Required
Default
Description

Key Field

String

Yes

The field name within each element whose value becomes the map key. A field name, not an OTTL path.

Value Field

String

No

(empty)

The field name within each element to use as the value. Leave empty to keep the whole element as the value.

Examples

Reshape a Windows Event Data array into a name-keyed map

Bindplane docs - Slice to Map - image 2

Configuration Tips

  • Key Field and Value Field are field names inside each element, not OTTL paths.

  • When two elements share the same key value, the later one overwrites the earlier in the resulting map.

Troubleshooting

The result is empty or unchanged

Symptoms: the target isn't a name-keyed map after the processor runs.

Solutions:

  1. Confirm the source field is actually a slice (array) and the Condition evaluates true.

  2. Verify the Key Field name exists on the slice elements.

Standalone Processor

Bindplane Resources

These XML and slice processors are designed to work together. Chain them to normalize, parse, and reshape XML end to end:

Last updated

Was this helpful?