Telegraf multiple input to multiple influxdb v2 buckets

Hello,
To date I retrieve VMware info from 3 datacenters on the same bucket. The problem is that via Grafana it’s relatively slow.
I would therefore like to separate the datacenters on 3 buckets
DC1 → Bucket1
DC2 → bucket2
DC3 → Bucket3
I tried via bucket_tag, but I can’t.

[[outputs.influxdb_v2]]
  urls = ["http://127.0.0.1:8086"]
  token = "xxxxxxx"
  organization = "xxxxxx"
  bucket = "bucket1"
  bucket_tag = "bucket1"
  exclude_bucket_tag = false
  user_agent = "telegraf_bucket1"

[[inputs.vsphere]]
  vcenters = [ "xxxxxxx/sdk" ]
  username = "xxxxxxx@vsphere.local"
  password = "xxxxxxx"
  [inputs.vsphere.tags]
    bucket = "bucket1"

3 identical files in /etc/telegraf/telegraf.d/DC1.conf, 2 and 3 with Bucket1 Bucket2 and Bucket3
But this does not return data on all buckets
What am I doing wrong?

If you could help me solve this routing of inputs to target buckets.

Franpom

There is a very similar question here. Anyway, leave your inputs as they are, adding the tag bucket="bucket1", bucket="bucket2" and bucket="bucket3". Then you can use

[[outputs.influxdb_v2]]
  urls = ["http://127.0.0.1:8086"]
  token = "xxxxxxx"
  organization = "xxxxxx"
  bucket = "bucket_for_remaining_data"
  bucket_tag = "bucket"
  exclude_bucket_tag = false
  user_agent = "telegraf_bucket1"

The output plugin will then use the value of the tag bucket to determine which bucket to use. This only works for influxdb_v2. Alternatively, you can create three output instances and use metric filtering

[[outputs.influxdb_v2]]
  urls = ["http://127.0.0.1:8086"]
  token = "xxxxxxx"
  organization = "xxxxxx"
  bucket = "bucket1"
  user_agent = "telegraf_bucket1"
  
  [outputs.influxdb_v2.tagpass]
    bucket = ["bucket1"]

[[outputs.influxdb_v2]]
  urls = ["http://127.0.0.1:8086"]
  token = "xxxxxxx"
  organization = "xxxxxx"
  bucket = "bucket2"
  user_agent = "telegraf_bucket1"
  
  [outputs.influxdb_v2.tagpass]
    bucket = ["bucket2"]

[[outputs.influxdb_v2]]
  urls = ["http://127.0.0.1:8086"]
  token = "xxxxxxx"
  organization = "xxxxxx"
  bucket = "bucket3"
  user_agent = "telegraf_bucket1"
  
  [outputs.influxdb_v2.tagpass]
    bucket = ["bucket3"]