Hi, telegraf is not recording data to influxdb cloud. When I run my config file on the desktop I get this output (I’m running the same config file in the cloud):
telegraf --config MQTT_Telegraf.conf --once --debug
2021-10-06T18:22:26Z D! [agent] Initializing plugins
2021-10-06T18:22:26Z D! [agent] Connecting outputs
2021-10-06T18:22:26Z D! [agent] Attempting connection to [outputs.influxdb_v2]
2021-10-06T18:22:26Z D! [agent] Successfully connected to outputs.influxdb_v2
2021-10-06T18:22:26Z D! [agent] Attempting connection to [outputs.file]
2021-10-06T18:22:26Z D! [agent] Successfully connected to outputs.file
2021-10-06T18:22:26Z D! [agent] Starting service inputs
2021-10-06T18:22:27Z I! [inputs.mqtt_consumer] Connected [ssl://xxxxxxxxxxxxxxx.s1.eu.hivemq.cloud:8883]
2021-10-06T18:22:27Z D! [inputs.mqtt_consumer] Session found [ssl://xxxxxxxxxxxxxxx.s1.eu.hivemq.cloud:8883]
2021-10-06T18:22:27Z D! [agent] **Stopping service inputs**
2021-10-06T18:22:27Z D! [inputs.mqtt_consumer] Disconnecting [ssl://xxxxxxxxxxxxxxx.s1.eu.hivemq.cloud:8883]
2021-10-06T18:22:27Z D! [inputs.mqtt_consumer] Disconnected [ssl://xxxxxxxxxxxxxxx.s1.eu.hivemq.cloud:8883]
2021-10-06T18:22:27Z D! [agent] Input channel closed
2021-10-06T18:22:27Z I! [agent] Hang on, flushing any cached metrics before shutdown
2021-10-06T18:22:27Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2021-10-06T18:22:27Z D! [outputs.influxdb_v2] Buffer fullness: 0 / 10000 metrics
2021-10-06T18:22:27Z I! [agent] Stopping running outputs
2021-10-06T18:22:27Z D! [agent] Stopped Successfully
my MQTT message looks like this:
sensors,value=15,temp=6
my config file looks like this:
[[outputs.influxdb_v2]]
urls = ["https://us-central1-1.gcp.cloud2.influxdata.com"]
token = "$INFLUX_TOKEN"
organization = "myorg"
bucket = "MQTT_data"
[[inputs.mqtt_consumer]]
servers = ["ssl://xxxxxxxxxxxxxxxxxxx.s1.eu.hivemq.cloud:8883"]
topics = [
"my/test/topic"
]
topic_tag = "topic"
qos = 2
max_undelivered_messages = 100
persistent_session = true
client_id = "username"
username = "username"
password = "password123"
data_format = "influx"
tag_keys = [
"value",
"temp",
]
[[outputs.file]]
files = ["stdout"]
data_format = "influx"