Skip to main content
Version: 0.14.0 (stable)

Regex-filter

This is a filter-type SmartModule that tests the input record against a provided regular expression. The record is returned if there is a match.

Usage example

To demonstrate how to use the Regex certified SmartModule with the SMDK tool.

info

All smartmodule versions are marked with x.y.z. To find the latest version, run:

  • fluvio hub smartmodule list

First, we need to download it to our cluster:

$ fluvio hub download infinyon/regex-filter@x.y.z

Second, we create a file transform.yaml defining our regular expression:

# transform.yaml
transforms:
- uses: infinyon/regex-filter@x.y.z
  with:
    regex: "[Cc]at"

Let's use smdk test to see it in action:

$ smdk test --text '{"fact": "Cats have supersonic hearing"}' --transforms-file ./transform.yaml
{"fact": "Cats have supersonic hearing"}
$ smdk test --text '{"fact": "Dogs have sweat glands at the bottom of their paws"}' --transforms-file ./transform.yaml
[No output returned]