If you want to change the topic name to which a source connector writes, or object name thatβs created on a target by a sink connector, the RegExRouter is exactly what you need.
To use the Single Message Transform you specify the pattern in the topic name to match, and its replacement. To drop a prefix of test- from a topic you would use:
" transforms " : " dropTopicPrefix " ,
" transforms.dropTopicPrefix.type " : " org.apache.kafka.connect.transforms.RegexRouter " ,
" transforms.dropTopicPrefix.regex " : " test-(.*) " ,
" transforms.dropTopicPrefix.replacement " : " $1 "
Read more: π Twelve Days of SMT π - Day 4: RegExRouter