You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My telegraf instance receives new config files automatically from an external service, so I'd like to validate the config file works before running it. It should catch these errors:
Invalid TOML
Plugins which are not compiled into the binary
Incorrect plugin options
This could be implemented as a new command-line flag --check-config. If it passes, it returns 0, and if it fails, it returns 78 (or any other code except 1) to differentiate this from a failed --test.
The --test flag is inadequate for this purpose for 3 reasons:
It returns 1 if any of the inputs fail, even though the config is valid
It takes a long time because it has to wait for each input to timeout
It doesn't work in a dev environment that doesn't have network access to all the targets
Expected behavior
..
Actual behavior
..
Additional info
No response
The text was updated successfully, but these errors were encountered:
@llamafilm please check the binary in PR #15732 available once CI finished the tests. Please run telegraf with the config check subcommand and let me know if this fixes the issue!
Thanks! This works as expected, and takes care of all the issues I was thinking of. It returns 1 on failure, which is actually fine since this command would never be combined with --test.
Use Case
My telegraf instance receives new config files automatically from an external service, so I'd like to validate the config file works before running it. It should catch these errors:
This could be implemented as a new command-line flag
--check-config
. If it passes, it returns 0, and if it fails, it returns 78 (or any other code except 1) to differentiate this from a failed--test
.The
--test
flag is inadequate for this purpose for 3 reasons:Expected behavior
..
Actual behavior
..
Additional info
No response
The text was updated successfully, but these errors were encountered: