Vector provides a subcommand, validate, that checks the validity of your Vector configuration and exits. Here’s an example:

vector validate /etc/vector/vector.toml

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:

  1. That all of the sources, transforms, and sinks include all required fields.
  2. All fields are of the proper type.

Topology checks

These checks verify that the configuration file contains a valid topology:

  1. At least one source is defined
  2. At least one sink is defined
  3. All inputs for each topology component (specified using the inputs parameter) contain at least one value.
  4. 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:

  1. All components have the pre-requisites to run, e.g. data directories exist and are writable.
  2. 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.toml