# Inject JSON messages to InfluxDB

**URL:** https://discourse.nodered.org/t/inject-json-messages-to-influxdb/33847
**Category:** General
**Created:** [6 October 2020 16:25 UTC](https://discourse.nodered.org/t/inject-json-messages-to-influxdb/33847 "2020-10-06T16:25:23Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![rparada](https://avatars.discourse-cdn.com/v4/letter/r/73ab20/32.png) [@rparada](https://discourse.nodered.org/u/rparada)
#### Post date: [6 October 2020 16:25 UTC](https://discourse.nodered.org/t/inject-json-messages-to-influxdb/33847/1 "2020-10-06T16:25:23Z")

</div>

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.

[![](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/2/627aaee029bc8dc414ced4e79582da93b961975e.jpeg "Integración de Node-Red, InfluxDB y Grafana") ](https://www.youtube.com/watch?v=I7f63Xb8cVE)

However, my current projects require a more complex architecture.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/a/6acefd6f1cd0a59a5da03cbfaca7ac4b93b54464.png)

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

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/a/fafd7e63972f81af42b9f6d546371966ef18688f.png)

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

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [6 October 2020 17:01 UTC](https://discourse.nodered.org/t/inject-json-messages-to-influxdb/33847/2 "2020-10-06T17:01:47Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [20 October 2020 17:02 UTC](https://discourse.nodered.org/t/inject-json-messages-to-influxdb/33847/3 "2020-10-20T17:02:04Z")

</div>

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