Update config generation docs

closes #1925
This commit is contained in:
Cameron Sparr 2016-10-25 13:47:38 +01:00
parent 393d129982
commit 61269c3500
3 changed files with 37 additions and 40 deletions

View File

@ -85,45 +85,42 @@ if you don't have it already. You also must build with golang version 1.5+.
## How to use it: ## How to use it:
```console See usage with:
$ telegraf --help
Telegraf, The plugin-driven server agent for collecting and reporting metrics.
Usage:
telegraf [commands|flags]
The commands & flags are:
config print out full sample configuration to stdout
version print the version to stdout
--config <file> 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 ## Configuration

View File

@ -95,7 +95,7 @@ Examples:
telegraf config > telegraf.conf telegraf config > telegraf.conf
# generate config with only cpu input & influxdb output plugins defined # 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 # run a single telegraf collection, outputing metrics to stdout
telegraf --config telegraf.conf -test telegraf --config telegraf.conf -test

View File

@ -12,10 +12,10 @@ telegraf config > telegraf.conf
``` ```
To generate a file with specific inputs and outputs, you can use the 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 ## Environment Variables