Hello Community,
Thank you for your efforts !
This is my first experience with Telegraf and InfluxDB and I need your help.
I’m parsing the JSON payload sent from mqtt broker, the fieldset and timestamp are OK
while the measurement and Tags are replaced with unexpected values:
My MQTT Broker is sending the following json
{
"fields": {
"cache_size": 16384.0,
"core_id": 0,
"cpu_cores": 8,
"vendor_id": "GenuineIntel"
},
"measurement": "cpuinfo",
"tags": {
"architecture": "x86_64",
"cpuinfo_name": "proc0",
"os": "Debian"
},
"time": "1706804130618257510"
}
The Telegraf config:
[[inputs.mqtt_consumer]]
data_format = "xpath_json"
servers = [
"tcp://mosquitto.mosquitto-mqtt.svc.cluster.local:1883"
]
topics = [
"vvp.v1.detailed.metrics/#"
]
[[inputs.mqtt_consumer.xpath]]
metric_name = "measurement"
[[inputs.mqtt_consumer.xpath]]
metric_selection = "/measurement"
[[inputs.mqtt_consumer.xpath]]
timestamp = "/time"
[[inputs.mqtt_consumer.xpath]]
timestamp_format = "unix"
[[inputs.mqtt_consumer.xpath]]
field_selection = "/fields/*"
[[inputs.mqtt_consumer.xpath]]
tag_selection = "/tags/*"
Is there any thing missing ?
Thank you