Inject JSON messages to InfluxDB

Hi,

I'm newbie to Node-red and InfluxDB. My objective is to inject values from JSON values through InfluxDB to be displayed in Grafana. I have everything setup and even I could do the following tutorial satisfactory.

However, my current projects require a more complex architecture.

I get the following error since I don't know how to extract the values from multiple variables

image

I have two input messages: type 1

{"type":"1","origin":"application","version":"1.0.0","source_uuid":1,"timestamp":804834112,"message":{"protocol_version":2,"station_id":1,"management_container":{"action_id":{"originating_station_id":1,"sequence_number":1},"detection_time":804834112,"reference_time":804834112,"event_position":{"latitude":556709350,"longitude":125195400,"altitude":1639},"station_type":5,"confidence":{}},"situation_container":{"information_quality":0,"event_type":{"cause":94,"subcause":0}}}}

and type 2:

{"type":"2","origin":"application","version":"1.0.0","source_uuid":1,"timestamp":53493,"message":{"protocol_version":2,"station_id":1,"generation_delta_time":53493,"basic_container":{"station_type":5,"reference_position":{"latitude":556711920,"longitude":125214450,"altitude":2280},"confidence":{}},"high_frequency_container":{"head":0,"sd":0,"dir":0,"length":1023,"width":62,"c":0,"cc":0,"longitudinal":161,"rate":32767,"confidence":{}},"low_frequency_container":{}}}

I didn't configure anything in JSON converter. What should I do to split the message for variables and be able to visualize the data in real time in Grafana.

Thanks in advance

If you are a complete beginner with node-red then I strongly recommend watching the Node Red Essentials video guides that are linked from the node red docs. An hour spent doing that will give you useful background information into things like manipulating messages and will save you much time in the long run.

Having done that then initially forget about grafana. The important thing is to get the data into the database, then grafana will just work. So look at the influx docs and make sure you understand the concepts of Measurements, Fields and Tags. Then you can look at the help text for the influx node and build the messages so as to put the data into the database as you want. When looking at influx docs make sure it is v1.8 you are looking at, not v2 which is still very new.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.