Hey there,
I have a small problem concerning the configuration of telegraf to send data to the infux. My configs work for two out of three cases and I simply can’t figure out the problem.
The data arrive like that :
{“Time”:“2024-06-25T09:44:26”,“Uptime”:“10T17:51:48”,“UptimeSec”:,“Heap”:,“SleepMode”:“Dynamic”,“Sleep”:50,“LoadAvg”:19,“MqttCount”:,“POWER”:“OFF”,“Wifi”:{“AP”:1,“SSId”:"“,“BSSId”:”",“Channel”:1,“Mode”:“11n”,“RSSI”:36,“Signal”:-82,“LinkCount”:28,“Downtime”:“0T00:06:44”}}
{“Time”:“2024-06-25T09:44:26”,“AS”:{“power_in”:1,“Total_in”:3*.1,“power_out”:0,“Total_out”:0.0}}
{“Time”:“2024-06-25T09:44:31”,“AS”:{“power_in”:1***}}
And my config looks like this:
[[inputs.mqtt_consumer]]
Broker URLs for the MQTT server or cluster. To connect to multiple
clusters or standalone servers, use a seperate plugin instance.
servers = [“tcp://localhost:1883”]
Topics that will be subscribed to.
topics = [
“//#”,
]
topic_tag = “”
max_undelivered_messages = 10000
persistent_session = true
client_id = “***2”
Username and password to connect MQTT server.
username = “"
password = "!”
data_format = “json_v2”
[[inputs.mqtt_consumer.json_v2]]
[[inputs.mqtt_consumer.json_v2.object]]
path = “@this”
included_keys = [“AS_power_in”,“AS_Total_in”,]
[[outputs.influxdb_v2]]
urls = [“http://...:****”]
Token for authentication.
token = “$INFLUX_TOKEN”
organization = “***”
Destination bucket to write into.
bucket = “***”
exclude_bucket_tag = false
user_agent = “telegraf”
[agent]
debug = true
quiet = false
interval = “10s”
round_interval = false
metric_batch_size = 1000
metric_buffer_limit = 10000
collection_jitter = “2s”
flush_interval = “10s”
flush_jitter = “1s”
precision = “”
qos = 1
It would be great if someone would have an idea on what I possibly did wrong.
Thank you so much in advance!