Second set of eyes on my MQTT Telegraf config file please

This is my Telegraf config which does not write the data to InfluxDB Cloud.

[[outputs.influxdb_v2]]
  urls = ["https://us-central1-2.gcp.cloud2.influxdata.com"]
  token = "$INFLUX_TOKEN"
  organization = "myorg"
  bucket = "MQTT_sensor_data"


  [[inputs.mqtt_consumer]]
  servers = ["85857593b7caa3.s1.eu.hivemq.cloud:8883"]
  topics = [
    "my/test/topic"
  ]
  topic_tag = "topic"
  qos = 2
  max_undelivered_messages = 100
  persistent_session = true
  client_id = "influxusername"
  username = "influxusername"
  password = "password123"
  data_format = "influx"
  tag_keys = [
    "sensors",
    "sensor1",
    "sensor2",
  ]

This is my MQTT message from another client to my HiveMQ broker.

mosquitto_pub -h 85857593b7caa3.s1.eu.hivemq.cloud -p 8883 -u "username" -P "mypassword" -t 'my/test/topic' -m 'sensors, sensor1=counter value=0, sensor2=counter2 value=5'

What could be going wrong? And how would I know where to look for errors?

Probably start with the telegraf service logs. Are there any errors in there?

If that’s all clean, what’s in the influxdb service logs?

1 Like

Where would I find the Telegraf service logs? And is Telegraf supposed to be running in the cloud along side influxdb?

Did you find the log files?
In the telegraf config file (agent section) you can find the settings related to logging.

If everything is ok on the Telegraf side check the InflxDB logs, I’ve no experience with InflxDB cloud so I don’t know where to look for them.

Telegraf is not supposed to run alongside InflxDB cloud, as it’s SAAS and you get only the database, not a whole Virtual Machine. If you want Telegraf in the cloud you will need to get a VM on your own.