Error writing to outputs.influxdb_v2: failed to write metric (401 Unauthorized)

I collect tags using Telegraf, and sends them to InfluxDB 2.0.7. But telegraf throws an authorization error, where should I fix it or how?
root@vknyazhev-VirtualBox:/etc/telegraf# sudo systemctl status telegraf
в—Џ telegraf.service - The plugin-driven server agent for reporting metrics into InfluxDB
Loaded: loaded (/lib/systemd/system/telegraf.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2021-06-09 10:33:35 MSK; 1h 21min ago
Docs: GitHub - influxdata/telegraf: The plugin-driven server agent for collecting & reporting metrics.
Process: 7620 ExecReload=/bin/kill -HUP $MAINPID (code=exited, status=0/SUCCESS)
Main PID: 7597 (telegraf)
Tasks: 8 (limit: 1117)
CGroup: /system.slice/telegraf.service
в””в”Ђ7597 /usr/bin/telegraf -config /etc/telegraf/telegraf.conf -config-directory /etc/telegraf/telegraf.d

РёСЋРЅ 09 11:54:46 vknyazhev-VirtualBox telegraf[7597]: 2021-06-09T08:54:46Z E! [agent] Error writing to outputs.influxdb_v2: failed to write metric (401 Unauthorized): unauthorized: unauthorized access
РёСЋРЅ 09 11:54:46 vknyazhev-VirtualBox telegraf[7597]: 2021-06-09T08:54:46Z W! [outputs.influxdb] Metric buffer overflow; 62 metrics have been dropped
РёСЋРЅ 09 11:54:46 vknyazhev-VirtualBox telegraf[7597]: 2021-06-09T08:54:46Z E! [outputs.influxdb] When writing to [http://localhost:8086]: 401 Unauthorized
РёСЋРЅ 09 11:54:46 vknyazhev-VirtualBox telegraf[7597]: 2021-06-09T08:54:46Z E! [agent] Error writing to outputs.influxdb: could not write any address
РёСЋРЅ 09 11:54:55 vknyazhev-VirtualBox telegraf[7597]: 2021-06-09T08:54:55Z W! [outputs.influxdb_v2] Metric buffer overflow; 62 metrics have been dropped
РёСЋРЅ 09 11:54:56 vknyazhev-VirtualBox telegraf[7597]: 2021-06-09T08:54:56Z E! [outputs.influxdb_v2] When writing to [http://192.168.0.3:8086]: failed to write metric (401 Unauthorized): unauthorized: un
РёСЋРЅ 09 11:54:56 vknyazhev-VirtualBox telegraf[7597]: 2021-06-09T08:54:56Z E! [agent] Error writing to outputs.influxdb_v2: failed to write metric (401 Unauthorized): unauthorized: unauthorized access
РёСЋРЅ 09 11:54:56 vknyazhev-VirtualBox telegraf[7597]: 2021-06-09T08:54:56Z W! [outputs.influxdb] Metric buffer overflow; 62 metrics have been dropped
РёСЋРЅ 09 11:54:56 vknyazhev-VirtualBox telegraf[7597]: 2021-06-09T08:54:56Z E! [outputs.influxdb] When writing to [http://localhost:8086]: 401 Unauthorized
РёСЋРЅ 09 11:54:56 vknyazhev-VirtualBox telegraf[7597]: 2021-06-09T08:54:56Z E! [agent] Error writing to outputs.influxdb: could not write any address

That’s an auth problem while writing to InfluxDB2
E! [outputs.influxdb] When writing to [http://localhost:8086]: 401 Unauthorized

my guess is that you don’t have the correct token to authenticate to the database

Hi!
Do I insert it in the telegraf config file?For example:

Token for authentication.

token = “ayK1YVVKiTnBPL4PTzjSMwOfrN6mgWUZK6XV05xlOgrViC-IB7W9xxSQfl9seinUwDSowZUiqUBjEuBrqvGdRA==”