base64.decode
Decode a field to base64.
Description
The processor will decode the value of the target field from base64 and store the
result in the target field. It is not allowed to decode the .Position
field.
Configuration parameters
Name | Type | Default | Description |
---|---|---|---|
field | string | null | Field is the reference to the target field. Note that it is not allowed to
base64 decode the For more information about the format, see Referencing fields. |
Examples
Decode a base64 encoded string
This example decodes the base64 encoded string stored in
.Payload.After
. Note that the result is a string, so if you want to
further process the result (e.g. parse the string as JSON), you need to chain
other processors (e.g. json.decode
).
Configuration parameters
Name | Value |
---|---|
field | .Payload.After.foo |
Record difference
Before | After | ||||
1 | { | 1 | { | ||
2 | "position": "dGVzdC1wb3NpdGlvbg==", | 2 | "position": "dGVzdC1wb3NpdGlvbg==", | ||
3 | "operation": "create", | 3 | "operation": "create", | ||
4 | "metadata": { | 4 | "metadata": { | ||
5 | "key1": "val1" | 5 | "key1": "val1" | ||
6 | }, | 6 | }, | ||
7 | "key": "test-key", | 7 | "key": "test-key", | ||
8 | "payload": { | 8 | "payload": { | ||
9 | "before": null, | 9 | "before": null, | ||
10 | "after": { | 10 | "after": { | ||
11 | - | "foo": "YmFy" | 11 | + | "foo": "bar" |
12 | } | 12 | } | ||
13 | } | 13 | } | ||
14 | } | 14 | } |