# Configure Telegraf multi input and output instance

**URL:** <https://community.influxdata.com/t/configure-telegraf-multi-input-and-output-instance/28588>\
**Category:** Telegraf\
**Tags:** telegraf\
**Created:** [February 13, 2023, 5:53pm UTC](https://community.influxdata.com/t/configure-telegraf-multi-input-and-output-instance/28588 "2023-02-13T17:53:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![renanmsampaio](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@renanmsampaio](https://community.influxdata.com/u/renanmsampaio)\
**Post date:** [February 13, 2023, 5:53pm UTC](https://community.influxdata.com/t/configure-telegraf-multi-input-and-output-instance/28588/1 "2023-02-13T17:53:43Z")

</div>

How can I configure telegraf to connect a VMware server and a SQL server and put the collected data to a diferent buckets?

I have the different buckets configured, but I need to put telegraf at the same server (windows) and using the same config file to collect data from different servers (SQL and VMware).

---

<div class="post-metadata">

**Author:** ![jpowers](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jpowers/32/8569_2.png) [@jpowers](https://community.influxdata.com/u/jpowers)\
**Post date:** [February 13, 2023, 5:57pm UTC](https://community.influxdata.com/t/configure-telegraf-multi-input-and-output-instance/28588/2 "2023-02-13T17:57:27Z")

</div>

Take a look at [metric filtering](https://github.com/influxdata/telegraf/blob/master/docs/CONFIGURATION.md#metric-filtering), specifically the selectors. You can use them to send certain metric names to certain outputs.

In your case, you will want to outputs, one for each bucket, and then have a selector on each of these to send the SQL to one and the VMware data to the other.

---

<div class="post-metadata">

**Author:** ![renanmsampaio](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@renanmsampaio](https://community.influxdata.com/u/renanmsampaio)\
**Post date:** [February 14, 2023, 10:22am UTC](https://community.influxdata.com/t/configure-telegraf-multi-input-and-output-instance/28588/3 "2023-02-14T10:22:42Z")

</div>

**Would it be something like below?**

[agent]  
interval = “10s”  
round\_interval = true  
metric\_batch\_size = 1000  
metric\_buffer\_limit = 10000  
collection\_jitter = “0s”  
flush\_interval = “10s”  
flush\_jitter = “0s”  
precision = “”  
hostname = “”  
omit\_hostname = false  
[[outputs.influxdb\_v2]]  
urls = [“http s://url.local:8086”]  
token = “$INFLUX\_TOKEN1”  
organization = “ORG001”  
bucket = “SQL”

**[outputs.influxdb.tagpass]**  
\*\* influxdb\_database = [“SQL”]\*\*

[[inputs.sqlserver]]

**[inputs.sqlserver.tags]**  
\*\* influxdb\_database = “SQL”\*\*

servers = [  
“Server=192.168.10.20;Port=1433;User Id=;Password=;app name=telegraf;log=1;”,  
]  
database\_type = “SQLServer”  
include\_query =   
exclude\_query = [“SQLServerAvailabilityReplicaStates”, “SQLServerDatabaseReplicaStates”]

[agent]  
interval = “10s”  
round\_interval = true  
metric\_batch\_size = 1000  
metric\_buffer\_limit = 10000  
collection\_jitter = “0s”  
flush\_interval = “10s”  
flush\_jitter = “0s”  
precision = “”  
hostname = “”  
omit\_hostname = false  
[[outputs.influxdb\_v2]]  
urls = [“[https://url.local:8086](https://url.local:8086)”]  
token = “$INFLUX\_TOKEN2”  
organization = “ORG001”  
bucket = “vmware”

**[outputs.influxdb.tagpass]**  
\*\* influxdb\_database = [“VMware”]\*\*

[[inputs.vsphere]]

**[inputs.vmware.tags]**  
\*\* influxdb\_database = “VMware”\*\*

vcenters = [“h ttps://vcenter.local”]  
username = “pass@local”  
password = “1q2w3e4r5t6t”

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”,  
]

datacenter\_metric\_include =   
datacenter\_metric\_exclude = [“\*”]  
insecure\_skip\_verify = false

---

<div class="post-metadata">

**Author:** ![jpowers](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jpowers/32/8569_2.png) [@jpowers](https://community.influxdata.com/u/jpowers)\
**Post date:** [February 14, 2023, 2:13pm UTC](https://community.influxdata.com/t/configure-telegraf-multi-input-and-output-instance/28588/4 "2023-02-14T14:13:24Z")

</div>

That does look like one way to approach this.
