Hi, Im having issues getting data into influx, I would like to use my time stamp in the logs not the timestamp of the current time and I have a JSON object of all the various values to store for each time. I have been using the influxdb out node to simply write a single value but i'm now expanding.
my flow is
[{"id":"707fc5c5.ea6dcc","type":"debug","z":"e7262fe9.ed296","name":"CSV Compare","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":740,"y":120,"wires":[]},{"id":"913b2d0b.08f7e","type":"file in","z":"e7262fe9.ed296","name":"","filename":"/share/TEST3.csv","format":"lines","chunk":false,"sendError":false,"encoding":"none","x":270,"y":120,"wires":[["5efdb887.bab9d8"]]},{"id":"8c4a40da.9166e","type":"inject","z":"e7262fe9.ed296","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"","payload":"","payloadType":"date","x":80,"y":120,"wires":[["913b2d0b.08f7e"]]},{"id":"5efdb887.bab9d8","type":"csv","z":"e7262fe9.ed296","name":"","sep":",","hdrin":true,"hdrout":"none","multi":"one","ret":"\\n","temp":"","skip":"0","strings":true,"include_empty_strings":true,"include_null_values":true,"x":450,"y":120,"wires":[["707fc5c5.ea6dcc","b05b1b0e.8ace78"]]},{"id":"a8451793.4723b8","type":"debug","z":"e7262fe9.ed296","name":"CSV Start","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":720,"y":220,"wires":[]},{"id":"b05b1b0e.8ace78","type":"function","z":"e7262fe9.ed296","name":"","func":"// create object and populate with Influx tags\nvar tags = {}\ntags.node = msg.filename\n\n// create object for measurement values\nvar v = {}\nv.value = msg.payload // the measurement value\n\n// create and fill array for the payload\nvar arr = [] \narr[0] = v // the measurement value\narr[1] = tags\n\n// put the array into msg.payload and send it off\nmsg.payload = arr\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":580,"y":180,"wires":[["a8451793.4723b8","5f52ac8f.3a05b4"]]},{"id":"5f52ac8f.3a05b4","type":"influxdb batch","z":"e7262fe9.ed296","influxdb":"9d1d55a0.2f7ac8","precision":"s","retentionPolicy":"","name":"","x":790,"y":180,"wires":[]},{"id":"9d1d55a0.2f7ac8","type":"influxdb","hostname":"127.0.0.1","port":"8086","protocol":"http","database":"test","name":"","usetls":false,"tls":"d50d0c9f.31e858","influxdbVersion":"1.8-flux","url":"http://localhost:8086","rejectUnauthorized":true},{"id":"d50d0c9f.31e858","type":"tls-config","name":"","cert":"","key":"","ca":"","certname":"","keyname":"","caname":"","servername":"","verifyservercert":false}]
and the last thing before the influx batch node is
{"payload":[{"value":{"time":1582963394,"TWS":4.27,"TWD":255.1,"HDG":57.9,"Lat":-33.84757088,"Lon":151.2045955,"COG":-18.21666667,"SOG":0.078,"TWD+90":119.5,"TWD-90":299.5,"Mk Lat":-33.8571377,"Mk Lon":151.2539832,"U1 PTWS":5.413607,"U2 PTWDTC":278.683209,"U3 TWS":4.266739,"U6 PTWDT":267.788934,"U7 PHDGT":58.542436}},{"node":"/share/TEST3.csv"},"RegardlesLog"],"filename":"/share/TEST3.csv","parts":{"index":4,"ch":"\n","type":"string","id":"92398551.9305c8","count":null},"_msgid":"e85a1c01.3edcb","columns":"time,TWS,TWD,HDG,Lat,Lon,COG,SOG,TWD+90,TWD-90,Mk Lat,Mk Lon,U1 PTWS,U2 PTWDTC,U3 TWS,U6 PTWDT,U7 PHDGT","measurement":"RegardlesLog"}
I got errors when writing this to a influx 1.0 db but a 1.8 seemed happy however i don't know how i specify the DB to wright to and I don't see any of these values in my DB?
Its a bit of a mess after trying so many things so apologies if there is unneccicary bits in the JSON formatting