bloblang
Executes a Bloblang mapping on messages.
Bloblang is a language that enables a wide range of mapping, transformation, and filtering tasks. You can embed the mapping directly in the config, or load it from a separate file with the expression from "<path>", where the path is absolute or relative to the directory that Expanso Edge runs from.
# Config fields, showing default values
processor:
label: ""
bloblang: "" # No default (required)
Examples
- Filter array elements
- Aggregate nested data
Keep the original document but reduce an array down to only the elements that meet a condition.
processor:
bloblang: |
root = this
root.fans = this.fans.filter(fan -> fan.obsession > 0.5)
Transform and aggregate nested data into a single derived field.
processor:
bloblang: |
root.Cities = this.locations.
filter(loc -> loc.state == "WA").
map_each(loc -> loc.name).
sort().join(", ")
Fields
bloblang
The Bloblang mapping to execute on each message. The mapping constructs a new document that replaces (or filters) the original message. It can be embedded inline or loaded from a file with the from "<path>" expression.
Type: string