Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exporting CSV o InfluxDB2 #1741

Closed
ric-m opened this issue Oct 6, 2024 · 0 comments · Fixed by #1802
Closed

Exporting CSV o InfluxDB2 #1741

ric-m opened this issue Oct 6, 2024 · 0 comments · Fixed by #1802
Assignees
Labels
🐛 bug Something isn't working

Comments

@ric-m
Copy link

ric-m commented Oct 6, 2024

The application is working extremely well with data seamlessly transferred to an instance of InfluxDB2.I am using docker on a Raspberry Pi 5, latest OS 64 bit.

I have been testing a number of apps (speedtest-tracker one of them) and am now ready to create a stable "production" environment.

Speedtest-tracker has, through its internal database, accumulated quite a bit of data which would be useful to preserve by transferring it to the new instance of InfluxDB. The speedtest CSV export data is complete, along with a row of column headers.

InfluxDB requires an annotated CSV file. This is precisely where I am struggling.

Uploading the exported speedtest CSV file results in an error:

Failed to upload the selected CSV: error in csv.from(): failed to read metadata: missing expected annotation datatype. consider using the mode: "raw" for csv that is not expected to have annotations

I have found no guidance on using this 'raw' mode.

I had the idea of exporting some of the speedtest data from InfluxDB using a Flux query with the expectation I could re-use that for the exported speedtest file. The exported InfluxDB CSV file has the annotation:

#group,false,false,true,true,false,false,true,true,true,true,true
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,long,string,string,string,string,string
#default,_result,,,,,,,,,,,result,table,_start,_stop,_time,_value,_field,_measurement,server_host,server_id,server_name

Prepending this to the exported speedtest CSV was pretty hopeless, giving the error:

Failed to upload the selected CSV: error in csv.from(): failed to read metadata: failed to read annotations: wrong number of fields

Further inspection of the exported InfluxDB2 CSV file showed quite a different structure to that of the exported speedtest CSV, with data appearing in chunks, each chunk separated by the same annotation, as above.

The question is:
I'm assuming I can't be the first to want to export historical data to InfluxDB. Can anyone offer help as to the annotation required to match the output format of the speedtest CSV?
Thanks, Ric

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment