Telegraf sending same data to all databases create in influxdb

I am new to telegraf and influxdb I am able to collect my data from my devices but when I send it over to influxdb I create two databases impitools and vmware_esxi I specified on separate configs to send data to those databases but what I am noticing is that same data is being sent to both databases how do I fix this ? I have even have gone far as create user accounts in influxdb and giving users write access to specific db and it still does not help

/etc/telegraf/telegraf.d/impitool.conf

[[outputs.influxdb]]
urls = [“httpx://172.17.0.3:8086”]
database = “impitools”
timeout = “0s”
username = “tool”
password = “123123”

[[inputs.ipmi_sensor]]
path = “/usr/bin/ipmitool”
servers = [“test:test@lanplus(10.10.91.3)”]
interval = “30s”
timeout = “20s”

/etc/telegraf/telegraf.d/vmware_esxi_r410.conf

[[outputs.influxdb]]
urls = [“httpx://172.17.0.3:8086”]
database = “vmware_esxi”
database_tag = “vmware_esxi”
timeout = “0s”
username = “esx”
password = “123123”

[[inputs.vsphere]]
vcenters = [ “https://10.10.125.5/sdk” ]
username = “test”
password = “123123”

vm_metric_include = [
“cpu.demand.average”,
“cpu.idle.summation”,
“cpu.latency.average”,
“cpu.readiness.average”,
“cpu.ready.summation”,
“cpu.run.summation”,
“cpu.usagemhz.average”,
“cpu.used.summation”,
“cpu.wait.summation”,
“mem.active.average”,
“mem.granted.average”,
“mem.latency.average”,
“mem.swapin.average”,
“mem.swapinRate.average”,
“mem.swapout.average”,
“mem.swapoutRate.average”,
“mem.usage.average”,
“mem.vmmemctl.average”,
“net.bytesRx.average”,
“net.bytesTx.average”,
“net.droppedRx.summation”,
“net.droppedTx.summation”,
“net.usage.average”,
“power.power.average”,
“virtualDisk.numberReadAveraged.average”,
“virtualDisk.numberWriteAveraged.average”,
“virtualDisk.read.average”,
“virtualDisk.readOIO.latest”,
“virtualDisk.throughput.usage.average”,
“virtualDisk.totalReadLatency.average”,
“virtualDisk.totalWriteLatency.average”,
“virtualDisk.write.average”,
“virtualDisk.writeOIO.latest”,
“sys.uptime.latest”,
]
host_metric_include = [
“cpu.coreUtilization.average”,
“cpu.costop.summation”,
“cpu.demand.average”,
“cpu.idle.summation”,
“cpu.latency.average”,
“cpu.readiness.average”,
“cpu.ready.summation”,
“cpu.swapwait.summation”,
“cpu.usage.average”,
“cpu.usagemhz.average”,
“cpu.used.summation”,
“cpu.utilization.average”,
“cpu.wait.summation”,
“disk.deviceReadLatency.average”,
“disk.deviceWriteLatency.average”,
“disk.kernelReadLatency.average”,
“disk.kernelWriteLatency.average”,
“disk.numberReadAveraged.average”,
“disk.numberWriteAveraged.average”,
“disk.read.average”,
“disk.totalReadLatency.average”,
“disk.totalWriteLatency.average”,
“disk.write.average”,
“mem.active.average”,
“mem.latency.average”,
“mem.state.latest”,
“mem.swapin.average”,
“mem.swapinRate.average”,
“mem.swapout.average”,
“mem.swapoutRate.average”,
“mem.totalCapacity.average”,
“mem.usage.average”,
“mem.vmmemctl.average”,
“net.bytesRx.average”,
“net.bytesTx.average”,
“net.droppedRx.summation”,
“net.droppedTx.summation”,
“net.errorsRx.summation”,
“net.errorsTx.summation”,
“net.usage.average”,
“power.power.average”,
“storageAdapter.numberReadAveraged.average”,
“storageAdapter.numberWriteAveraged.average”,
“storageAdapter.read.average”,
“storageAdapter.write.average”,
“sys.uptime.latest”,
]
insecure_skip_verify = true

Hello @vegeta-x,
Sorry in advance if this is a silly question, but data from ipmi_sensor and vsphere is being sent to both db, “impitools” and “vmware_esxi”?

yes its happening now I looking for ipmi_sensor to just send to “impitools” and vsphere to “vmware_esxi

only I I can think of doing is creating multiple instances of telegraf running for each config
copied existing from “/usr/lib/telegraf/scripts” made changes to point to a single config or config directory and copied it over to “/etc/systemd/system/” and then did a “systemctl daemon-reload”
and then started the service I just created name each one differently this will work for me

Hello @vegeta-x,
Ah, I didn’t know you were only using one telegraf instance. Yes, you’ll need to run separate telegraf instances or direct the writes with namepass and other metric filtering. Please see a full example in this issue #809.

I would use a single Telegraf instance, there are very few situations where you would need more than one.

The example on issue #809 is a bit out of date, I don’t recommend using name_prefix/name_suffix. The best way to handle this is to use the attributes of the data to select the destination, here is the example in the documentation using namepass/namedrop to split writes. Another method, which is a bit more complicated to setup, is add a tag to the metric that can be later used to select the output.

thx I will look this solution down the road