Hello,
I’m using this configuration :
- sensors (python script) generating several (N) mqtt topics “vehicles/+/op_test”
- telegraf inputs.mqtt_consumers
- telegraf outputs.websocket
- grafana data source (grafana : live measurements) accepting websocket
here is the telegraf conf file:
[[inputs.mqtt_consumer]]
servers = [“tcp://192.168.0.78:1883”]
topics = [“vehicles/+/op_test”]
data_format = “json_v2”
[[inputs.mqtt_consumer.json_v2]]
[[inputs.mqtt_consumer.json_v2.tag]]
path = “id”
[[inputs.mqtt_consumer.json_v2.field]]
path = “timestamp”
[[inputs.mqtt_consumer.json_v2.field]]
path = “speed”
[[inputs.mqtt_consumer.json_v2.field]]
path = “coord.latitude”
[[inputs.mqtt_consumer.json_v2.field]]
path = “coord.longitude”
[[outputs.websocket]]
url = “ws://192.168.0.78:3000/api/live/push/custom_stream”
data_format = “influx”
[outputs.websocket.headers]
Authorization = “Bearer xxx…xxx”
my problem is that I’m not able to differentiate vehicle at grafana level, I would like to get one different websocket url per vehicle like this:
[[outputs.websocket]]
url = “ws://192.168.0.78:3000/api/live/push/custom_stream/”+id
…
“id” would come from the “id” from the input tag.
thanks guys, have a good day.
Olivier
Is it feasible? I could not find a solution yet.