Last active
August 7, 2020 19:28
-
-
Save jszwedko/e0f55c85445b428aa067315c64ab13b4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
➜ vector git:(master) echo 'hello' | cargo run -- --config /tmp/tmp.toml | |
Finished dev [unoptimized + debuginfo] target(s) in 0.49s | |
Running `target/debug/vector --config /tmp/tmp.toml` | |
Aug 07 15:18:46.732 INFO vector: Log level "info" is enabled. | |
Aug 07 15:18:46.738 INFO vector: Loading configs. path=["/tmp/tmp.toml"] | |
Aug 07 15:18:46.757 INFO vector: Vector is starting. version="0.11.0" git_version="v0.9.0-494-g21354bf" released="Fri, 07 Aug 2020 18:51:18 +0000" arch="x86_64" | |
Aug 07 15:18:46.759 INFO vector::sources::stdin: Capturing STDIN. | |
Aug 07 15:18:46.760 INFO vector::topology: Running healthchecks. | |
Aug 07 15:18:46.760 INFO vector::topology: Starting source "in" | |
Aug 07 15:18:46.760 INFO vector::topology::builder: Healthcheck: Passed. | |
Aug 07 15:18:46.761 INFO vector::topology: Starting transform "lua" | |
Aug 07 15:18:46.761 INFO vector::topology: Starting sink "out" | |
Aug 07 15:18:46.779 INFO vector::shutdown: All sources have finished. | |
Aug 07 15:18:46.779 INFO vector: Shutting down. | |
Aug 07 15:18:46.779 INFO source{name=in type=stdin}: vector::sources::stdin: finished sending | |
{"records":[{"value":{"host":"a-8cktst39ij0a","message":"hello","source_type":"stdin","timestamp":"2020-08-07T19:18:46.778527456Z"}}]} | |
Aug 07 15:18:46.782 INFO vector::topology: Shutting down... Waiting on: . 59 seconds left |
This file contains hidden or 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 = "stdin" | |
[transforms.lua] | |
# General | |
type = "lua" # required | |
inputs = ["in"] # required | |
version = "2" # required | |
# Hooks | |
hooks.process = """ | |
function (event, emit) | |
record = {} | |
record.value = event.log | |
records = {} | |
table.insert(records, record) | |
event.log = {} | |
event.log.records = records | |
-- Very important! Emit the processed event. | |
emit(event) | |
end | |
""" | |
[sinks.out] | |
type = "console" # required | |
inputs = ["lua"] # required | |
encoding.codec = "json" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If using HTTP sink: