# Handling mqtt 5 properties in telegraf

**URL:** <https://community.influxdata.com/t/handling-mqtt-5-properties-in-telegraf/25255>\
**Category:** Telegraf\
**Tags:** telegraf, mqtt\
**Created:** [June 1, 2022, 11:54am UTC](https://community.influxdata.com/t/handling-mqtt-5-properties-in-telegraf/25255 "2022-06-01T11:54:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sezanzeb](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/sezanzeb/32/10121_2.png) [@sezanzeb](https://community.influxdata.com/u/sezanzeb)\
**Post date:** [June 1, 2022, 11:54am UTC](https://community.influxdata.com/t/handling-mqtt-5-properties-in-telegraf/25255/1 "2022-06-01T11:54:23Z")

</div>

Hey, I’d like to put user-properties from mqtt 5 messages into tags in influxdb.

I haven’t been able to find anything related to telegraf and mqtt 5 properties. Are they not supported at all?

Thanks.

---

<div class="post-metadata">

**Author:** ![Jay\_Clifford](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jay_clifford/32/8287_2.png) [@Jay\_Clifford](https://community.influxdata.com/u/Jay_Clifford)\
**Post date:** [June 1, 2022, 1:15pm UTC](https://community.influxdata.com/t/handling-mqtt-5-properties-in-telegraf/25255/2 "2022-06-01T13:15:15Z")

</div>

Hi @sezanzeb,  
So I knew this was a feature that came in MQTTv5. I must admit I haven’t really done much work with them. Can you describe how a subscriber would usually access another client’s user-properties. We support MQTTv5 but I am not sure we have built any specific mapping for user-properties. Though with your insight we might be able to achieve a work around.

---

<div class="post-metadata">

**Author:** ![sezanzeb](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/sezanzeb/32/10121_2.png) [@sezanzeb](https://community.influxdata.com/u/sezanzeb)\
**Post date:** [June 2, 2022, 10:08am UTC](https://community.influxdata.com/t/handling-mqtt-5-properties-in-telegraf/25255/3 "2022-06-02T10:08:22Z")

</div>

Hey, thanks for your answer.

Forget what I said about tags.

If the internet connection dies, our device will remember the messages, and when the internet connection comes back send all of them.

Since afaik Telegraf is adding the timestamp, all of those messages would get wrong timestamps once they reach the server.

Instead, we want to use a user-property “time”, which is the time of when we measured our actual sensor. Once they reach Telegraf, we want Telegraf to use that timestamp for the InfluxDB insert.

The alternative is to use `json_v2`/`timestamp_key`. It seems Telegraf is using `paho.mqtt.golang`, there is this fork which supports mqtt 5, but it seems to be a bit different [GitHub - eclipse/paho.golang: Go libraries](https://github.com/eclipse/paho.golang), for example there is no `ClientOptions`. Therefore it is not a drop-in replacement.

We are interested in contributing and putting research into it if it is feasible. We don’t have go experts here though. Otherwise we’ll go with json payloads.

---

<div class="post-metadata">

**Author:** ![Jay\_Clifford](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jay_clifford/32/8287_2.png) [@Jay\_Clifford](https://community.influxdata.com/u/Jay_Clifford)\
**Post date:** [June 6, 2022, 10:31am UTC](https://community.influxdata.com/t/handling-mqtt-5-properties-in-telegraf/25255/4 "2022-06-06T10:31:32Z")

</div>

Hi @sezanzeb,  
Gotcha, I will raise this internally with our Telegraf maintainers team and get back to you with their answer. I will open an issue in github aswell. If you would mind linking to the branch that you found.

---

<div class="post-metadata">

**Author:** ![Jay\_Clifford](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jay_clifford/32/8287_2.png) [@Jay\_Clifford](https://community.influxdata.com/u/Jay_Clifford)\
**Post date:** [June 6, 2022, 10:50am UTC](https://community.influxdata.com/t/handling-mqtt-5-properties-in-telegraf/25255/5 "2022-06-06T10:50:10Z")

</div>

If you can add the branch information here: [MQTT Consumer: Support Reading User-Properties · Issue #11258 · influxdata/telegraf · GitHub](https://github.com/influxdata/telegraf/issues/11258#issue-1261676391)

---

<div class="post-metadata">

**Author:** ![nt294](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/nt294/32/14931_2.png) [@nt294](https://community.influxdata.com/u/nt294)\
**Post date:** [June 10, 2024, 9:06am UTC](https://community.influxdata.com/t/handling-mqtt-5-properties-in-telegraf/25255/6 "2024-06-10T09:06:22Z")

</div>

Are there any plans to implement this?
