bloblang
Executes a Bloblang mapping on messages.
Bloblang is a powerful language that enables a wide range of mapping, transformation and filtering tasks. For more information see xref:guides:bloblang/about.adoc[].
If your mapping is large and you’d prefer for it to live in a separate file then you can execute a mapping directly from a file with the expression from "<path>"
, where the path must be absolute, or relative from the location that Redpanda Connect is executed from.
Component rename
This processor was recently renamed to the mapping
processor in order to make the purpose of the processor more prominent. It is still valid to use the existing bloblang
name but eventually it will be deprecated and replaced by the new name in example configs.
Examples
Given JSON documents containing an array of fans:
We can reduce the fans to only those with an obsession score above 0.5, giving us:
With the following config:
When receiving JSON documents of the form:
We could collapse the location names from the state of Washington into a field Cities
:
With the following config:
Error handling
Bloblang mappings can fail, in which case the message remains unchanged, errors are logged, and the message is flagged as having failed, allowing you to use standard processor error handling patterns.
However, Bloblang itself also provides powerful ways of ensuring your mappings do not fail by specifying desired fallback behavior, which you can read about in Error handling.