Validating
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
How validation works
The 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
.
Correctness checks
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.
Topology checks
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
inputs
parameter) contain at least one value. - All inputs refer to valid and upstream sources or transforms.
Environment checks
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 --no-environment
flag:
vector validate --no-environment /etc/vector/vector.yaml
Skipping health checks
To validate the vector configuration even if the health-checked endpoints are not reachable
(for example, from a local workstation), but still run all the other environment checks, use
the [--skip-healthchecks
][skip_healthchecks] flag:
vector validate --skip-healthchecks /etc/vector/vector.yaml
Note: The configured data_dir
must still be writeable.