Avocado
Avocado

Reputation: 901

Kafka Connect - filter fields in value by regex

I would like to remove fields from a message value if they match a regex, e.g. /^__before_.+$/

original:

{
   "count": 5,
   "bags": 42,
   "__before_count": 4,
   "__before_bags": 19
}

desired:

{
   "count": 5,
   "bags": 42,
}

As far as I can tell, the only way to filter fields is with a hard coded list, e.g., with the ReplaceField transformation.

Is it possible to define a regex to filter out fields?

Upvotes: 0

Views: 1119

Answers (1)

OneCricketeer
OneCricketeer

Reputation: 191723

With built-in transforms, there is not, you need to write your own or find an external transform project that does it.

Upvotes: 1

Related Questions