Skip to content

infinyon/fluvio-jaq

Repository files navigation

fluvio-jq

SmartModule for processing json record using jq syntax. We use rust version of jq to process JSON data.

Playground

You can use the jaq playground to test Jq expression.

To Install

fluvio hub smartmodule download  infinyon/jaq@0.1.0

Example of usage in Connector

download connector:

cdk hub download infinyon/http-source@0.3.8

Have connector.yaml file like this cat.yaml

apiVersion: 0.1.0
meta:
  version: 0.3.8
  name: cat-facts-transformed
  type: http-source
  topic: cat-facts-data-transform

http:
  endpoint: https://catfact.ninja/fact
  interval: 10s

transforms:
  - uses: infinyon/jaq@0.1.0
    with:
      filter: ".fact"

For Developer

To get a simple fruit:

smdk test --file test-data/fruit-input.json --raw -e filter=.fruit
{"name":"apple","color":"green","price":1.2}

With pipeline:

smdk test --file test-data/creatures-input.json --raw -e filter=".[] | .name"
["Sammy","Bubbles","Splish","Splash"]

About

SmartModule for processing jq

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published