content/telegraf/v1/commands/secrets/list.md
The telegraf secrets list command lists known secrets and secret stores.
{{% note %}}
This command requires your configuration file that contains the secret store
definitions you want to access. If the --config or --config-directory flags
are not included in the command, Telegraf checks the
default configuration file location.
{{% /note %}}
If you haven't configured a secret store, use
telegraf plugins secretstores
to list available secret store plugins.
View secret store plugin configuration documentation in the
Telegraf GitHub repository.
telegraf [global-flags] secrets list [flags] [SECRET_STORE_ID[ ...[SECRET_STORE_ID]]]
| Argument | Description |
|---|---|
| SECRET_STORE_ID | ID of the secret store to list secrets from. You can include multiple, space-delimited IDs. If no ID(s) are provided, the command lists secrets from all secret stores. |
| Flag | Description | |
|---|---|---|
--reveal-secret | Print secret values | |
-h | --help | Show command help |
{{% caption %}} Also see Telegraf global flags. {{% /caption %}}
The following example assumes the Telegraf configuration file that contains the secret store definition is at the default location.
telegraf secrets list
{{% code-placeholders "CUSTOM_CONFIG_PATH" %}}
telegraf --config CUSTOM_CONFIG_PATH secrets list
{{% /code-placeholders %}}
CUSTOM_CONFIG_PATH{{% /code-placeholder-key %}}
with the non-default filepath to your Telegraf configuration file containing
your secret store definitions.{{% code-placeholders "SECRET_STORE_ID" %}}
telegraf secrets list SECRET_STORE_ID
{{% /code-placeholders %}}
SECRET_STORE_ID{{% /code-placeholder-key %}}
with the ID of the secret store to retrieve the secret from.To print secret values with listing secrets and secret stores, include the
--reveal-secret flag:
telegraf secrets list --reveal-secret