host value set for
mqtt_consumer events appears to be random. Is there a way I can set the hostname in telegraph based upon a topic component.
Welcome! Can you please share your config?
I should have set not random, it will use the
[agent]/hostname value but I want to specify the hostname value from the mqtt topic.
[[inputs.mqtt_consumer]] topics = [ "tele/+/+/+/SENSOR" ] username = "myuser" password = "mypass" data_format = "json"
I want the hostname to be a value associated with the device that sent the mqtt message. So, for the above mqtt topic, it would be nice to use a regular expression to specify one of the components as the hostname.
topics = [ "tele/(+:hostname)/+/+/SENSOR" ]