content/telegraf/v1/commands/config/create.md
The telegraf config create command returns a full Telegraf configuration
containing all plugins as an example. You can also apply section or plugin
filters to reduce the output to the plugins you need.
telegraf [global-flags] config create [flags]
| Flag | Description | |
|---|---|---|
--section-filter | Filter sections to print separated by : (Valid values are agent, global_tags, outputs, processors, aggregators and inputs) | |
--input-filter | Filter inputs to enable separated by : | |
--output-filter | Filter outputs to enable separated by : | |
--aggregator-filter | Filter aggregators to enable separated by : | |
--processor-filter | Filter processors to enable separated by : | |
--secretstore-filter | Filter secret-stores to enable separated by : | |
-h | --help | Show command help |
{{% caption %}} Also see Telegraf global flags. {{% /caption %}}
telegraf config create
telegraf config create > telegraf.conf
To print a configuration containing only a Modbus input plugin and an InfluxDB v2 output plugin, run the following:
telegraf config create \
--section-filter "inputs:outputs" \
--input-filter "modbus" \
--output-filter "influxdb_v2"