telegraf/cmd/telegraf
Joshua Powers 0db9bafb79
docs: Clarify watch config behavior (#13285)
2023-05-18 08:40:53 -06:00
..
README.md docs: Add symlink to command documentation (#9926) 2021-10-15 13:05:37 -06:00
agent.conf feat: Plugin state-persistence (#12166) 2023-03-01 15:34:48 -07:00
cmd_secretstore.go feat(agent): Add command-line option to specify password (#12812) 2023-03-09 11:54:27 +01:00
main.go docs: Clarify watch config behavior (#13285) 2023-05-18 08:40:53 -06:00
main_test.go feat: secret-store implementation (#11232) 2022-12-08 09:53:06 -07:00
main_win_test.go chore: Remove deprecated build tags (#11867) 2022-09-22 13:25:31 -05:00
pprof.go chore: Enable G112 and G114 rules for gosec (#12986) 2023-04-03 15:23:05 +02:00
printer.go chore: eliminate unnecessary use of quoted strings in printf (#12722) 2023-02-23 06:49:36 -07:00
telegraf.go chore: Enable G301, G302 and G306 rules for gosec (#13022) 2023-04-04 08:51:08 -06:00
telegraf_posix.go fix(secrets): Warn if OS limit for locked memory is too low (#12993) 2023-04-03 10:49:07 +02:00
telegraf_windows.go fix(secrets): Warn if OS limit for locked memory is too low (#12993) 2023-04-03 10:49:07 +02:00

README.md

Telegraf Commands & Flags

The following page describes some of the commands and flags available via the Telegraf command line interface.

Usage

General usage of Telegraf, requires passing in at least one config file with the plugins the user wishes to use:

telegraf --config config.toml

Help

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.

Version

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

Config

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