Single Message Transforms for Confluent Platform¶
Single Message Transformations (SMTs) are applied to messages as they flow through Connect. SMTs transform inbound messages after a source connector has produced them, but before they are written to Kafka. SMTs transform outbound messages before they are sent to a sink connector. The following SMTs are available for use with Kafka Connect.
For a tutorial and a deep dive into this topic, see How to Use Single Message Transforms in Kafka Connect.
If none of the available SMTs provide the necessary transformation, you can create your own. See Custom transformations for more information.
|Cast fields or the entire key or value to a specific type (for example, to force an integer field to a smaller width).
|Drop either a key or a value from a record and set it to null.
|Extract the specified field from a Struct when schema present, or a Map in the case of schemaless data. Any null values are passed through unmodified.
|Replace the record topic with a new topic derived from its key or value.
|Filter (Apache Kafka)
|Drop all records. Designed to be used in conjunction with a Predicate.
|Include or drop records that match a configurable
|Flatten a nested data structure. This generates names for each field by concatenating the field names at each level with a configurable delimiter character.
|Moves or copies fields in a record key or value into the record’s header.
|Wrap data using the specified field name in a Struct when schema present, or a Map in the case of schemaless data.
|Insert field using attributes from the record metadata or a configured static value.
|Mask specified fields with a valid null value for the field type.
|Update the record’s topic field as a function of the original topic value and the record’s timestamp field.
|Update the record topic using the configured regular expression and replacement string.
|Filter or rename fields.
|Set the schema name, version, or both on the record’s key or value schema.
|Convert timestamps between different formats such as Unix epoch, strings, and Connect Date and Timestamp types.
|Update the record’s topic field as a function of the original topic value and the record timestamp.
|Manage tombstone records. A tombstone record is defined as a record with the entire value field being null, whether or not it has ValueSchema.
|Replace the record key with a new key formed from a subset of fields in the record value.