Changing a payload.obects field name

I'm in the process of creating an influx database which reads in the three properties of my central heating system. These readings are being fed from a separate program running on an old raspberry pi to the latest model b+ or whatever. The transferred data values are a mixed collection of text, number and line feeds, sent from the old pi every few minutes.

My node red on the newer pi breaks apart the data sent to it and then recombines just the three pieces of data and sends that payload to the influxdb

I can get the data into the influxdb, but the field names appear to be the first three readings sent to them as the payload below

03/06/2019, 13:56:54node: 1f372cdb.5eaea3
boilerOnOffState : msg : Object
object
payload: object
16: 16
OFF: "OFF"
19.4: 19.4
topic: "boilerOnOffState"
_msgid: "74e30e4f.e3c93"

Influx output


1559566033781021327 16      19.2           OFF
1559566043830384018 16      19.2           OFF
1559566053845750425 16      19.2           OFF
>

My question as a new time node red user of less than 3-4 days, What do I need to do in order to add meaningful field names? Can this be done before the transfer to influxdb with node red, or can I adjust the field names in influxDB itself?

Which influxdb node are you using?

Also, I have moved your post to the General category as this category is for sharing completed projects that might be of interest to other users.

Thanks

I wasn't sure where to put this - btw I'm using influxdb out node - node-red-contrib-influxdb version 0.2.2

If you put your data into an object, like this:

{
"FieldName1":FieldValue1,
"FieldName2":FieldValue2
}

And feed it to the InfluxDB node, it will do what you want.

The nodes documentation also gives lots of examples.

That object should be in msg.payload as described in the Info tab for the node.

Thanks that did the trick - I was trying to make it too complicated. I'm still getting my head around this javascript syntax