It would be great if there was a way to validate a tickScript source file to make sure it is syntactically correct before posting it to the kapacitor server. This way users can handle any syntax errors locally before executing the define command
Something like
Kapacitor validate_syntax cpuAlert.tick
The packages we provide ship with a binary called tickfmt which will validate and format a TICKscript file.
I like the idea of adding a command for it to the CLI.
@nathanielc what package is that binary part of? Is there any documentation on how to invoke it?
It is a part of any of the Kapacitor packages we provide on the downloads page, i.e the rpm, deb and even the tars. If you installed via the package it should be in your PATH, and the binary has a simple usage/help message.
$ tickfmt -h
Usage: tickfmt [options] [path...]
If no source files are provided reads from STDIN.
Options:
-b create backup files with extension '.orig'.
-w write formatted contents to source file instead of STDOUT.
I see. I had installed via homebrew and it doesn't look to be part of that install. I do see it as part of the rpms and tarballs however, thanks. As an additional feature request it would be good if it was part of the brew install as well
@rconn01 Agreed. Thanks
@nathanielc - Is there a tickfmt binary compatible with OSX? The downloads page instructs users to download kapacitor via homebrew for OSX and as @rconn01 mentioned the tickfmt binary isn't included as part of the brew install.
Most helpful comment
I see. I had installed via homebrew and it doesn't look to be part of that install. I do see it as part of the rpms and tarballs however, thanks. As an additional feature request it would be good if it was part of the brew install as well