Telegraf: Parsing Different MQTT Topics to Different Measurements/Databases


I have the following telegraf configuration.

  servers = ["tcp://localhost:1883"]
  qos = 0
  connection_timeout = "30s"
  topics = [
  persistent_session = true
  client_id = "OrcunMQTT"
  data_format = "json"
  name_suffix = "_kesy_vm"
  json_query = "values"
  tag_keys = ["id"]
  json_time_key = "t"
  json_time_format = "unix_ms"
  data_format = "json"
  fielddrop = ["t"]
  database = "vm_metrics"
  urls = ["http://localhost:8086"]
  namepass = ["*_vm"]

Here I managed to pipe the things in MQTT topic to a single database but what I want is; I want telegraf to listen to many different topics and move the JSON’s read into different databases/measurements.

How can I do that?



If I define multiple inputs and outputs it fails.