The following page describes some of the commands and flags available via the Telegraf command line interface.
General usage of Telegraf, requires passing in at least one config file with the plugins the user wishes to use:
telegraf --config config.toml
To get the full list of subcommands and flags run:
telegraf help
Here are some commonly used flags that users should be aware of:
--config-directory
: Read all config files from a directory--debug
: Enable additional debug logging--once
: Run one collection and flush interval then exit--test
: Run only inputs, output to stdout, and exit
Check out the full help out for more available flags and options.
While telegraf will print out the version when running, if a user is uncertain what version their binary is, run the version subcommand:
telegraf version
The config subcommand allows users to print out a sample configuration to stdout. This subcommand can very quickly print out the default values for all or any of the plugins available in Telegraf.
For example to print the example config for all plugins run:
telegraf config > telegraf.conf
If a user only wanted certain inputs or outputs, then the filters can be used:
telegraf config --input-filter cpu --output-filter influxdb