telegraf/cmd/telegraf
Paweł Żak 5878278fca
chore: resolve linter issues for unhandled-error (#11969)
2022-10-12 14:23:53 -06:00
..
README.md docs: Add symlink to command documentation (#9926) 2021-10-15 13:05:37 -06:00
agent.conf feat: Migrate to urfave/cli (#11700) 2022-08-24 21:46:58 -05:00
main.go chore: resolve linter issues for unhandled-error (#11969) 2022-10-12 14:23:53 -06:00
main_test.go chore: resolve linter issues for unhandled-error (#11969) 2022-10-12 14:23:53 -06:00
main_win_test.go chore: Remove deprecated build tags (#11867) 2022-09-22 13:25:31 -05:00
pprof.go feat: Migrate to urfave/cli (#11700) 2022-08-24 21:46:58 -05:00
printer.go chore: update to go1.19.1 (#11776) 2022-09-08 12:49:36 -06:00
telegraf.go chore: resolve linter issues for unhandled-error (#11969) 2022-10-12 14:23:53 -06:00
telegraf_posix.go chore: Remove deprecated build tags (#11867) 2022-09-22 13:25:31 -05:00
telegraf_windows.go chore: resolve linter issues for unhandled-error (#11969) 2022-10-12 14:23:53 -06:00

README.md

Telegraf Commands & Flags

Usage

telegraf [commands]
telegraf [flags]

Commands

command description
config print out full sample configuration to stdout
version print the version to stdout

Flags

flag description
--aggregator-filter <filter> filter the aggregators to enable, separator is :
--config <file> configuration file to load
--config-directory <directory> directory containing additional *.conf files
--watch-config Telegraf will restart on local config changes. Monitor changes using either fs notifications or polling. Valid values: inotify or poll. Monitoring is off by default.
--plugin-directory directory containing *.so files, this directory will be searched recursively. Any Plugin found will be loaded and namespaced.
--debug turn on debug logging
--deprecation-list print all deprecated plugins or plugin options
--input-filter <filter> filter the inputs to enable, separator is :
--input-list print available input plugins.
--output-filter <filter> filter the outputs to enable, separator is :
--output-list print available output plugins.
--pidfile <file> file to write our pid to
--pprof-addr <address> pprof address to listen on, don't activate pprof if empty
--processor-filter <filter> filter the processors to enable, separator is :
--quiet run in quiet mode
--section-filter filter config sections to output, separator is :. Valid values are agent, global_tags, outputs, processors, aggregators and inputs
--sample-config print out full sample configuration
--once enable once mode: gather metrics once, write them, and exit
--test enable test mode: gather metrics once and print them. No outputs are executed!
--test-wait wait up to this many seconds for service inputs to complete in test or once mode. Implies --test if not used with --once
--usage <plugin> print usage for a plugin, ie, telegraf --usage mysql
--version display the version and exit

Examples

Generate a telegraf config file:

telegraf config > telegraf.conf

Generate config with only cpu input & influxdb output plugins defined:

telegraf config --input-filter cpu --output-filter influxdb

Run a single telegraf collection, outputting metrics to stdout:

telegraf --config telegraf.conf --test

Run telegraf with all plugins defined in config file:

telegraf --config telegraf.conf

Run telegraf, enabling the cpu & memory input, and influxdb output plugins:

telegraf --config telegraf.conf --input-filter cpu:mem --output-filter influxdb

Run telegraf with pprof:

telegraf --config telegraf.conf --pprof-addr localhost:6060