Stateful Data Flow Beta Build composable event-driven data pipelines in minutes.

Get Started Now

Regex

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

<TODO: Make this example use only fluvio>

First, we need to download it to our cluster:

$ fluvio hub download infinyon/[email protected]

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

# transform.yaml
transforms:
- uses: infinyon/[email protected]
  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]