Vector provides a subcommand,
validate, that checks the validity of your Vector configuration and exits.
Here’s an example:
vector validate /etc/vector/vector.yaml
You can also check multiple files:
vector validate /etc/vector/vector*.toml
validate subcommand performs several sets of checks on the configuration you point
it to. If validation succeeds, Vector exits with a code of
0; if it fails, it exits with a code of
78. At any time, you can see documentation for the command by running
vector validate --help.
These checks verify the correctness of fields for components defined within all configuration files, including:
- That all of the sources, transforms, and sinks include all required fields.
- All fields are of the proper type.
These checks verify that the configuration file contains a valid topology:
- At least one source is defined
- At least one sink is defined
- All inputs for each topology component (specified using the
inputsparameter) contain at least one value.
- All inputs refer to valid and upstream sources or transforms.
Finally, these checks ensure that Vector is running in an environment that can support the configured topology:
- All components have the pre-requisites to run, e.g. data directories exist and are writable.
- All sinks can connect to their specified targets.
These environment checks can be disabled using the
vector validate --no-environment /etc/vector/vector.yaml