Vector provides a subcommand
validate which checks the validity of any number
of configuration files and then exits:
- Fields Only
- Fields and Topology
vector validate /etc/vector/vector.toml
The validate subcommand checks the correctness of fields for components defined within a configuration file, including:
- All sources, transforms, and sinks include all non-optional fields.
- All fields are of the proper type.
If validation fails, Vector will exit with a
78, and if validation succeeds
Vector will exit with a
These checks can be expanded with flags such as
--topology, which causes
validate to also verify that the configuration file contains a valid topology,
expanding the above checks with the following:
- At least one source is defined.
- At least one sink is defined.
inputsvalues contain at least one value (cannot be empty).
inputsvalues reference valid and upstream source or transform components.
To see other customization options for the
validate subcommand run
vector validate --help.
## Validating Environment
Vector also provides a
--dry-run option which prevents regular execution and
instead validates a configuration file as well as the runtime environment:
- Config Only
- Config + Healthchecks
vector --config /etc/vector/vector.toml --dry-run
If a dry run fails, Vector will exit with a
78, and if it succeeds Vector
will exit with a
A dry run expands upon the
validation checks above with the following:
- All components are capable of running (data directories exist, are writable, etc).
You'll notice in the second example above you can pass the
flag to also run health checks for all defined sinks.
- All sinks are able to connect to their targets.