Telegraf commands and flags

This page documents an earlier version of Telegraf. Telegraf v1.26 is the latest stable version.

The telegraf command starts and runs all the processes necessary for Telegraf to function.


telegraf [commands]
telegraf [flags]


configPrint out full sample configuration to stdout.
versionPrint version to stdout.


--aggregator-filter <filter>Filter aggregators to enable. Separator is :.
--config <file>Configuration file to load.
--config-directory <directory>Directory containing additional *.conf files.
--watch-configRestart Telegraf on local configuration changes. Use either fs notifications (inotify) or polling (poll). Disabled by default
--plugin-directory <directory>Directory containing *.so files to search recursively for plugins. Found plugins are loaded, tagged, and identified.
--debugEnable debug logging.
--input-filter <filter>Filter input plugins to enable. Separator is :.
--input-listPrint available input plugins.
--output-filterFilter output plugins to enable. Separator is :.
--output-listPrint available output plugins.
--pidfile <file>File to write PID to.
--pprof-addr <address>pprof address to listen on. Disabled by default.
--processor-filter <filter>Filter processor plugins to enable. Separator is :.
--quietRun in quiet mode.
--section-filter <filter>Filter configuration sections to output (agent, global_tags, outputs, processors, aggregators and inputs). Separator is :.
--sample-configPrint full sample configuration.
--onceGather metrics once, write them, and exit.
--testGather metrics once and print them.
--test-waitNumber of seconds to wait for service inputs to complete in test or once mode.
--usage <plugin>Print plugin usage (example: telegraf --usage mysql).
--versionPrint Telegraf version.


Generate a Telegraf configuration file

telegraf config > telegraf.conf

Generate configuration with only CPU input and InfluxDB output plugins defined

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

Run a single Telegraf configuration, outputting metrics to stdout

telegraf --config telegraf.conf --test

Run Telegraf with all plugins defined in configuration file**

telegraf --config telegraf.conf

Run Telegraf, enabling the CPU and memory input plugins and InfluxDB output plugin**

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

Run Telegraf with pprof

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

Was this page helpful?

Thank you for your feedback!

Introducing InfluxDB 3.0

The new core of InfluxDB built with Rust and Apache Arrow. Available today in InfluxDB Cloud Dedicated.

Learn more

State of the InfluxDB Cloud Serverless documentation

The new documentation for InfluxDB Cloud Serverless is a work in progress. We are adding new information and content almost daily. Thank you for your patience!

If there is specific information you’re looking for, please submit a documentation issue.