github.com/influxdata/telegraf@v1.30.3/docs/COMMANDS_AND_FLAGS.md (about)

     1  # Telegraf Commands & Flags
     2  
     3  The following page describes some of the commands and flags available via the
     4  Telegraf command line interface.
     5  
     6  ## Usage
     7  
     8  General usage of Telegraf, requires passing in at least one config file with
     9  the plugins the user wishes to use:
    10  
    11  ```bash
    12  telegraf --config config.toml
    13  ```
    14  
    15  ## Help
    16  
    17  To get the full list of subcommands and flags run:
    18  
    19  ```bash
    20  telegraf help
    21  ```
    22  
    23  Here are some commonly used flags that users should be aware of:
    24  
    25  * `--config-directory`: Read all config files from a directory
    26  * `--debug`: Enable additional debug logging
    27  * `--once`: Run one collection and flush interval then exit
    28  * `--test`: Run only inputs, output to stdout, and exit
    29  
    30  Check out the full help out for more available flags and options.
    31  
    32  ## Version
    33  
    34  While telegraf will print out the version when running, if a user is uncertain
    35  what version their binary is, run the version subcommand:
    36  
    37  ```bash
    38  telegraf version
    39  ```
    40  
    41  ## Config
    42  
    43  The config subcommand allows users to print out a sample configuration to
    44  stdout. This subcommand can very quickly print out the default values for all
    45  or any of the plugins available in Telegraf.
    46  
    47  For example to print the example config for all plugins run:
    48  
    49  ```bash
    50  telegraf config > telegraf.conf
    51  ```
    52  
    53  If a user only wanted certain inputs or outputs, then the filters can be used:
    54  
    55  ```bash
    56  telegraf config --input-filter cpu --output-filter influxdb
    57  ```