Dot Expander
Synopsis
Expands fields containing dots in their names into nested objects.
Schema
- dot_expander:
field: <ident>
path: <string>
description: <text>
if: <script>
ignore_failure: <boolean>
on_failure: <processor[]>
on_success: <processor[]>
tag: <string>
Configuration
The following fields are used to define the processor:
| Field | Required | Default | Description |
|---|---|---|---|
field | Y | - | Field containing dot-separated names to expand |
path | N | Same as field | Where the value is written instead of the expanded field path. It is used verbatim, so a single-segment value produces no nesting at all |
description | N | - | Explanatory note |
if | N | - | Conditional expression |
ignore_failure | N | false | Continue processing on errors |
on_failure | N | - | Processors to run on failure |
on_success | N | - | Processors to run on success |
tag | N | - | Identifier for logging |
disabled | N | false | When true, the processor is skipped and the event continues to the next one. Lets you take a processor out of the path without removing its configuration |
Details
The processor converts flat field names with dot notation into nested object structures. This is particularly useful for transforming flattened data into hierarchical formats, improving data readability and standardizing field structures for nested processing.
The field must contain at least one dot. Also, nested expansions create complex object structures.
Intermediate objects are created as needed, and the original flat key is removed once the value has been written.
path does not prefix the expansion — it replaces the destination outright. The expansion is always driven by the destination path, so path: target writes a plain target field while path: a.b.c nests three levels.
Deeply nested fields can lead to performance issues.
Examples
Basic
Expanding a dotted field into nested objects... | |
creates a nested structure: | |
Redirecting to Another Path
| |
so the value lands at | |
To nest it somewhere else, write the destination as a dotted path of its own... | |
which expands the way the path is written: | |
Conditionals
Expand only when a condition is met... | |
result: | |
Error Handling
When a field doesn't contain any dots... | |
handle the error: | |