marinebon / mbon-dashboard-server

server software for MBON early alert dashboard using Docker
1 stars 2 forks source link

influx v2 csv inputs #77

Closed 7yl4r closed 2 months ago

7yl4r commented 3 months ago

The csv input needs to be reworked and I would like to try using influxdb's native csv handler. Below are some example commands that work to input data into influx:

influx write --bucket imars_bucket --format csv "#group,true,false,false,false,true,true
#dataType,dateTime:RFC3339,double,double,double,measurement,tag
,Time,mean,climatology,anomaly,_measurement,location
,2020-01-01T00:00:00Z,1.1,0.00656,,rrs_667,01
,2021-01-01T00:00:00Z,2.2,0.0647,,rrs_667,01
,2022-01-01T00:00:00Z,3.3,0.639,,rrs_667,01
"

influx write --bucket imars_bucket --format csv "\
#constant measurement,rrs_667,,,,,
#group,true,false,false,false,true,true
#dataType,dateTime:RFC3339,double,double,double,tag
,Time,mean,climatology,anomaly,location
,2019-01-01T00:00:00Z,10.1,0.000656,,01
,2018-01-01T00:00:00Z,20.2,0.00647,,01
,2017-01-01T00:00:00Z,30.3,0.0639,,01
"

influx write --bucket imars_bucket --format csv "\
#constant measurement,rrs_667,,
#constant tag,location,01,,
#group,true,false,false,false
#dataType,dateTime:RFC3339,double,double,double
,Time,mean,climatology,anomaly
,2001-01-01T00:00:00Z,1.1,2.1,3.1
,2002-01-01T00:00:00Z,,2,2,3,2
,2003-01-01T00:00:00Z,1.3,,3.3
,2004-01-01T00:00:00Z,1.4,2.4,
"

Note that the annotated csv chunks here may not work in the influx "upload data" GUI because "extended annotated csv" (needed for using constant) is not supported for the GUI.

7yl4r commented 2 months ago

ended up not going this way and used the python API instead.