telegraf/cmd/telegraf
Sven Rebhan c3e53193d2
feat(logging): Implement structured logging (#15751)
Co-authored-by: Thomas Casteleyn <thomas.casteleyn@me.com>
2024-09-06 15:52:22 -05:00
..
README.md docs: Add symlink to command documentation (#9926) 2021-10-15 13:05:37 -06:00
agent.conf feat(logging): Implement structured logging (#15751) 2024-09-06 15:52:22 -05:00
cmd_config.go feat(agent): Add config check sub-command (#15732) 2024-08-16 12:36:35 -05:00
cmd_plugins.go feat(cli): List available parsers and serializers (#15426) 2024-05-31 10:32:35 +02:00
cmd_secretstore.go chore(linters): Remove blank identifiers and errors which are not needed to handle (#14399) 2023-12-07 08:09:01 -07:00
cmd_win_service.go chore(windows): Rework Windows service handling (#15372) 2024-06-03 16:05:39 -05:00
cmd_win_service_notwindows.go chore(windows): Rework Windows service handling (#15372) 2024-06-03 16:05:39 -05:00
main.go feat(agent): Add config check sub-command (#15732) 2024-08-16 12:36:35 -05:00
main_test.go fix(inputs.temp): Recover pre-v1.22.4 temperature sensor readings (#14575) 2024-01-18 07:56:47 -07:00
main_win_test.go chore(linters): Fix findings found by testifylint for Windows and enable it. (#14238) 2023-11-02 06:40:30 -06:00
pprof.go fix(agent): Ensure import of required package for pprof support (#15054) 2024-04-02 03:35:34 -04:00
printer.go chore(linters): Enable `preferDecodeRune` and `preferFprint` checkers for gocritic (#14453) 2023-12-15 07:01:25 -07:00
telegraf.go feat(logging): Implement structured logging (#15751) 2024-09-06 15:52:22 -05:00
telegraf_posix.go chore(windows): Rework Windows service handling (#15372) 2024-06-03 16:05:39 -05:00
telegraf_windows.go chore: Update go to v1.23.0 (#15766) 2024-08-30 14:23:51 -05:00

README.md

Telegraf Commands & Flags

The following page describes some of the commands and flags available via the Telegraf command line interface.

Usage

General usage of Telegraf, requires passing in at least one config file with the plugins the user wishes to use:

telegraf --config config.toml

Help

To get the full list of subcommands and flags run:

telegraf help

Here are some commonly used flags that users should be aware of:

  • --config-directory: Read all config files from a directory
  • --debug: Enable additional debug logging
  • --once: Run one collection and flush interval then exit
  • --test: Run only inputs, output to stdout, and exit

Check out the full help out for more available flags and options.

Version

While telegraf will print out the version when running, if a user is uncertain what version their binary is, run the version subcommand:

telegraf version

Config

The config subcommand allows users to print out a sample configuration to stdout. This subcommand can very quickly print out the default values for all or any of the plugins available in Telegraf.

For example to print the example config for all plugins run:

telegraf config > telegraf.conf

If a user only wanted certain inputs or outputs, then the filters can be used:

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