Last active
February 17, 2021 09:35
-
-
Save JeanMertz/26b44ba3ca61a1bfe6a43ca9d467956e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./target/debug/vector -q --config vector.toml | |
{"foo":true} | |
{"bar":true} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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