Secret stores for my config directory

Hello !
I want to use secret store plugins with some config.files.
At first, i use several config files and i want to close user and password, which use into such config.
At second, i use directory config path with --config-directory
I found next documentation: here and here. So i can to make valid config files, but i can’t test it and use.
I use command: telegraf --test --config /my_dir/config/cam.conf secrets set tstore cam_url and create one key, cam_url, diffenetly i can get key value telegraf --test --config /my_dir/config/cam.conf secrets get tstore cam_url, but i can’t test this config, i can’t get error and telegraf do not see my stores if i test my config standart method: telegraf --test --config /my_dir/config/cam.conf or telegraf --config-directory /my_dir/config/ --test

Question:

  • how create several secret stores and keys for config directory
  • how test it
  • and how run config with secret store plugins, where is ts saving, will it keep after reboot?
  • how use keyctl for creating and getting secret keys? perhaps it will be more simple

Here’s how you define multiple secret stores…with the id:
Each secret store requires a unique id that configurations using the secrets can reference.
For example:

[[secretstores.os]]
   id = "mystore"
   keyring = "telegraf"
[[outputs.influxdb_v2]]
  urls = ["http://127.0.0.1:8086"]
  token = "@{mystore:influx_token}"
  organization = "myorg"
  bucket = "mybucket"

I’m not sure how to set multiple and test though. @srebhan might know more details here.

Thanks!

i see this example for official docs. I understand how change my config file/files, but i don’t understand how create directly.
For example:

  • step 1: run command 1, 2… n
  • step 2: change config files (this step in understand)
  • step 3: check config files (for example - run with key --test) - How i must understand that my secret stores work?
  • step 4: profit

and i have more difficult telegraf configuration: i have config directory, where i put some files for several target (snmp, ping, servers… and more).
Summary:

  • i don’t understand how create secret
  • i can test single configuration file, but i don’t know how test and how run telegraf with config directory
  • i don’t know how manage my secret store (i can create, but i don’t know how delete any secrets)

Hello @vladimir.n.kostyanik,
Sorry for the delay,
I’m jsut seeing this response.
Have you seen this blog post?

It shows youhow to set up the secret with different environments as well as links to docs on how to set up secret stores for your env. What env are you operating with?