github.com/outbrain/consul@v1.4.5/website/source/docs/commands/validate.html.md (about) 1 --- 2 layout: "docs" 3 page_title: "Commands: Validate" 4 sidebar_current: "docs-commands-validate" 5 description: > 6 The `consul validate` command tests that config files are valid by 7 attempting to parse them. Useful to ensure a configuration change will 8 not cause consul to fail after a restart. 9 --- 10 11 # Consul Validate 12 13 The `consul validate` command performs a thorough sanity test on Consul 14 configuration files. For each file or directory given, the command will 15 attempt to parse the contents just as the `consul agent` command would, 16 and catch any errors. 17 18 This is useful to do a test of the configuration only, without actually 19 starting the agent. This performs all of the validation the agent would, so 20 this should be given the complete set of configuration files that are going 21 to be loaded by the agent. This command cannot operate on partial 22 configuration fragments since those won't pass the full agent validation. 23 24 For more information on the format of Consul's configuration files, read the 25 consul agent [Configuration Files](/docs/agent/options.html#configuration-files) 26 section. 27 28 ## Usage 29 30 Usage: `consul validate [options] FILE_OR_DIRECTORY...` 31 32 Returns 0 if the configuration is valid, or 1 if there are problems. 33 34 ```text 35 $ consul validate /etc/consul.d 36 Configuration is valid! 37 ``` 38