Last active
August 28, 2020 17:17
-
-
Save kevinhooke/1aeacba0b3170c5c4187abe53613aed8 to your computer and use it in GitHub Desktop.
Kafka CMT transform examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- multiple transforms as a csv list | |
"transforms": "fieldRenames,recordTimeStamp,constantExample", | |
- whitelist on field names is case sensitive and needs to match transformed names | |
this is a list of fields allowed in the output (not the input fields if they are transformed or renamed) | |
"fields.whitelist": "EXAMPLE,EVENT_TIMESTAMP,EXAMPLE_STRING", | |
- transforms on field names are case sensitive | |
"transforms.fieldRenames.type": "org.apache.kafka.connect.transforms.ReplaceField$Value", | |
"transforms.fieldRenames.renames": "EXPL:EXAMPLE" // from : to | |
- inserting timestamp from record as a new field | |
"transforms.recordTimeStamp.type": "org.apache.kafka.connect.transforms.InsertField$Value", | |
"transforms.recordTimeStamp.timestamp.field": "EVENT_TIMESTAMP", | |
- inserting a constant strimg | |
"transforms.constantExample.type": "org.apache.kafka.connect.transforms.InsertField$Value", | |
"transforms.constantExample.static.field": "EXAMPLE_STRING", | |
"transforms.constantExample.static.value": "Example value" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment