Conditional Execution

Learn how to conditionally execute a transformation filter.

A conditional property if can be configured on each filter to determine if that filter should be applied or skipped. When a filter is skipped, record flow to the next filter without any modification.

if configuration accepts a Simple Connect Expression that must return to TRUE or FALSE. If the configured expression does not evaluate to a boolean value the filter chain will fail.

The BOOLEAN value returned from the filter condition can be inverted by setting the property invert to TRUE.

For example, the below filter will only be applied on records having a log message containing “BadCredentialsException”

filters.TagSecurityException.type=io.streamthoughts.kafka.connect.filepulse.filter.AppendFilter
filters.TagSecurityException.if={{ contains(data.logmessage, BadCredentialsException) }}
filters.TagSecurityException.invert=false
filters.TagSecurityException.field=tags
filters.TagSecurityException.values=SecurityAlert

The following list shows the supported functions that return a BOOLEAN type for use with the if config property:

Last modified November 22, 2022: release version 2.8.0 (36e96395)