When starting Vector to use the generate command, users may be surprised to see their stdout is polluted and not valid TOML.
hoverbear@OBSIDIAN:/git/timberio/vector$ cargo run -- generate stdin//console
Finished dev [unoptimized + debuginfo] target(s) in 0.25s
Running `target/debug/vector generate stdin//console`
Jul 09 16:06:21.268 INFO vector: Log level "info" is enabled.
data_dir = "/var/lib/vector/"
[sources.source0]
max_length = 102400
type = "stdin"
[sinks.sink0]
healthcheck = true
inputs = ["source0"]
type = "console"
[sinks.sink0.buffer]
type = "memory"
max_events = 500
when_full = "block"
hoverbear@OBSIDIAN:/git/timberio/vector$ cargo run -- generate stdin//console > test.toml
Finished dev [unoptimized + debuginfo] target(s) in 0.26s
Running `target/debug/vector generate stdin//console`
hoverbear@OBSIDIAN:/git/timberio/vector$ cat test.toml
Jul 09 16:07:31.098 INFO vector: Log level "info" is enabled.
data_dir = "/var/lib/vector/"
[sources.source0]
max_length = 102400
type = "stdin"
[sinks.sink0]
healthcheck = true
inputs = ["source0"]
type = "console"
[sinks.sink0.buffer]
type = "memory"
max_events = 500
when_full = "block"
This issue requests that vector generate stdin//console > test.toml works again as expected.
Todo:
Probably should be part of #2961
For history, this was changed in https://github.com/timberio/vector/pull/2964/files#diff-639fbc4ef05b315af92b4d836c31b023R73
I鈥檓 also curious if we could test for this? Assuming it low-effort and easy. I do not think it鈥檚 worth an elaborate testing strategy.
The test alone would be straightforward, but an additional check , ex. make test-command, would need to be added. In it, we could add these kind of command level tests.
Sounds good to me. If it鈥檚 simple I think it鈥檚 worth it.
As @fanatid noted, it would be nice for list command too also be clean.