Hi Folks.
I’m exploring Telegraf to consume some MQTT data from a set of devices living off in the woods. ( long story ). I feel like I am missing some core concepts. anyway specifically here’s what’s up:
I’m starting with a simplest MQTT message ( from MQTT Explorer )
MQTT:Explorer:> arc-km-assistant/sensor/arc_km_cpu_utilization/state
Which has a value of the CPU % utilization. which is fine.
All the MQTT messages from the devices are “flat” → no JSON etc etc.
I’m running telegraf from the command line, passing in my conf. file and just watching the log output. I understand the output in the log is what would be passed on to InfluxDB3.
In my conf file I am remapping the topic message thing via the name_override directive
here is my inputs.mqtt_consumer.topic_parsing block:
[[inputs.mqtt_consumer.topic_parsing]]
# MQTT:Explorer:> arc-km-assistant/sensor/arc_km_cpu_utilization/state
#Traffic no xlation:> topic=arc-km-assistant/sensor/arc_km_memory_utilization/state value=“92.8” 1765857460844249977
topic = “arc-km-assistant/sensor/arc_km_cpu_utilization/state”
# topic = “+/+/+/+” # this is a brute which matches all 4 element mqtt messages. used in exploration
# remap topic first position to 'site, second to type, third to cpu to pass along ‘cpu’ for processors.pivot to slide the value into that name
tags = “site/type/cpu/_”
[[processors.pivot]]
tag_key = “cpu”
value_key = “value”
so what’s confusing me is that this is the output I get:
ARC_Telemetry_Dev,site=arc-km-assistant,type=sensor arc_km_cpu_utilization=20.6 1766087365095091243
I had thought that I was remapping the 3rd position ( arc_km_cpu… ) to cpu, and then using that pivot dealy to move the float value in.
so that I would have cpu=20.8
what have I missed with the tag reassignment and pivot processing?
oh also, is this they proper telegraf way to do this remapping?
