Skip to content

Instantly share code, notes, and snippets.

@JeanMertz
Last active February 17, 2021 09:35
Show Gist options
  • Save JeanMertz/26b44ba3ca61a1bfe6a43ca9d467956e to your computer and use it in GitHub Desktop.
Save JeanMertz/26b44ba3ca61a1bfe6a43ca9d467956e to your computer and use it in GitHub Desktop.
./target/debug/vector -q --config vector.toml
{"foo":true}
{"bar":true}
[sources.in]
type = "generator"
format = "shuffle"
count = 1
lines = ['[{"foo": 1}, {"bar": 2}]']
[transforms.parse]
type = "remap"
inputs = ["in"]
source = '.message = parse_json!(string!(.message))'
[transforms.split]
type = "route"
inputs = ["parse"]
route.0 = '.message[0] != null'
route.1 = '.message[1] != null'
route.2 = '.message[2] != null'
[transforms.event1]
type = "remap"
inputs = ["split.0"]
source = '. = .message[0]'
[transforms.event2]
type = "remap"
inputs = ["split.1"]
source = '. = .message[1]'
[transforms.event3]
type = "remap"
inputs = ["split.2"]
source = '. = .message[2]'
[sinks.out]
type = "console"
inputs = ["event1", "event2", "event3"]
encoding.codec = "json"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment