Skip to main content

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

version: 2.2
pipelines:
- id: example
status: running
connectors:
# define source and destination ...
processors:
- id: example
plugin: "base64.decode"
settings:
# Field is the reference to the target field. Note that it is not
# allowed to base64 decode the `.Position` field.
# For more information about the format, see [Referencing
# fields](https://conduit.io/docs/using/processors/referencing-fields).
# Type: string
field: ""
# Whether to decode the record key using its corresponding schema from
# the schema registry.
# Type: bool
sdk.schema.decode.key.enabled: "true"
# Whether to decode the record payload using its corresponding schema
# from the schema registry.
# Type: bool
sdk.schema.decode.payload.enabled: "true"
# Whether to encode the record key using its corresponding schema from
# the schema registry.
# Type: bool
sdk.schema.encode.key.enabled: "true"
# Whether to encode the record payload using its corresponding schema
# from the schema registry.
# Type: bool
sdk.schema.encode.payload.enabled: "true"

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

version: 2.2
pipelines:
- id: example
status: running
connectors:
# define source and destination ...
processors:
- id: example
plugin: "base64.decode"
settings:
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
}

scarf pixel conduit-site-docs-using-processors