diff --git a/README.md b/README.md index d338caaa9..efba9e6c7 100644 --- a/README.md +++ b/README.md @@ -85,45 +85,42 @@ if you don't have it already. You also must build with golang version 1.5+. ## How to use it: -```console -$ telegraf --help -Telegraf, The plugin-driven server agent for collecting and reporting metrics. +See usage with: -Usage: - - telegraf [commands|flags] - -The commands & flags are: - - config print out full sample configuration to stdout - version print the version to stdout - - --config configuration file to load - --test gather metrics once, print them to stdout, and exit - --config-directory directory containing additional *.conf files - --input-filter filter the input plugins to enable, separator is : - --output-filter filter the output plugins to enable, separator is : - --usage print usage for a plugin, ie, 'telegraf -usage mysql' - --debug print metrics as they're generated to stdout - --quiet run in quiet mode - -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, outputing 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 ``` +telegraf --help +``` + +### Generate a telegraf config file: + +``` +telegraf config > telegraf.conf +``` + +### Generate config with only cpu input & influxdb output plugins defined + +``` +telegraf --input-filter cpu --output-filter influxdb config +``` + +### Run a single telegraf collection, outputing 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 +``` + ## Configuration diff --git a/cmd/telegraf/telegraf.go b/cmd/telegraf/telegraf.go index 347da1985..0f94c6e2c 100644 --- a/cmd/telegraf/telegraf.go +++ b/cmd/telegraf/telegraf.go @@ -95,7 +95,7 @@ Examples: telegraf config > telegraf.conf # generate config with only cpu input & influxdb output plugins defined - telegraf config -input-filter cpu -output-filter influxdb + telegraf --input-filter cpu --output-filter influxdb config # run a single telegraf collection, outputing metrics to stdout telegraf --config telegraf.conf -test diff --git a/docs/CONFIGURATION.md b/docs/CONFIGURATION.md index d05fc987e..9b2eb99d8 100644 --- a/docs/CONFIGURATION.md +++ b/docs/CONFIGURATION.md @@ -12,10 +12,10 @@ telegraf config > telegraf.conf ``` To generate a file with specific inputs and outputs, you can use the --input-filter and -output-filter flags: +--input-filter and --output-filter flags: ``` -telegraf config -input-filter cpu:mem:net:swap -output-filter influxdb:kafka +telegraf --input-filter cpu:mem:net:swap --output-filter influxdb:kafka config ``` ## Environment Variables