Newbie: remapping tags and processor pivot

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?

I have never used this specific input before but it appears that it is working correctly to me. tags = “site/type/cpu/_” is going to create the tags site=arc-km-assistant,type=sensor,cpu=arc_km_cpu_utilization but then using processors.pivot is telling it to take the tag from cpu=arc_km_cpu_utilization and pivot it to use as the value name instead i.e. arc_km_cpu_utilization=20.6 I believe what you are looking for is the rename processor. The pivot example in the mqtt config is if you have multiple different lines printing the same info with only one tag to differentiate them and wanting to merge it into one line that uses that tag instead. I don’t have your exact input config so this may be a little off but I think what you are looking for is roughly this:

[[inputs.mqtt_consumer.topic_parsing]]
  topic = “arc-km-assistant/sensor/arc_km_cpu_utilization/state”
  tags = “site/type/cpu/_”
  data_format = "value"
  data_type = "float"
[[processors.rename]]
  [[processors.rename.replace]]
    field = “value”
    dest = “cpu”

That should print out:
ARC_Telemetry_Dev,site=arch-km-assistant,type=sensor,cpu=arc_km_cpu_utilization cpu=20.6 1766087365095091243