Telegraf...specify influxdb database per mqtt input?

Welcome to the community!

Yes, this is possible in Telegraf and is called metric filtering, see here in the docs:

https://docs.influxdata.com/telegraf/v1/configuration/

Here is a simple example.

[[inputs.mqtt_consumer]]
# other plugin configs...
measurement_name = "mqtt_1"

[[inputs.mqtt_consumer]]
# other plugin configs...
measurement_name = "mqtt_2"

[[outputs.influxdb]]
# other plugin configs...
namepass = ["mqtt_1"]

[[outputs.influxdb]]
# other plugin configs...
namepass = ["mqtt_2"]
1 Like