Stateful Services (private release) Build composable event-driven data pipelines in minutes.
Use Cases
Documentation
Blog Articles
Resources
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.
<TODO: Make this example use only fluvio>
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
# transform.yaml transforms: - uses: infinyon/[email protected] with: regex: "[Cc]at"
Let’s use smdk test to see it in action:
smdk test
$ 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]