Best (any?) way to push CSV to influx

For context this relates to an upload service included in the IoTaWatt energy monitor. The device has supported uploading to the OSS 1.x version for a couple of years now. Recently made the changes to upload to 2.0. The device can push data to various upstream servers seamlessly, so sometimes that may involve uploading a backlog after a communications outage.

Now I’d like to provide the ability to upload essentially all of the data collected so that larger users can aggregate their data in the cloud version. Problem is that the line protocol is way verbose and repetitive. The CSV format would be very efficient.

I can see where CSV can be pulled from files, but have not come across a simple way to just push annotated CSV to an influx endpoint. Not really interested in agents, python scripts or other middleware. I can build clean annotated CSV to send directly.

Surely this is possible given the wholesale conversion to CSV and tables in flux. Can someone point me at the best (any) way to do this?

Hello @overeasy,
You could write a task with csv.from() function with flux:
https://docs.influxdata.com/influxdb/v2.0/reference/flux/stdlib/csv/from/
But please see:

Additionally you can use the CLI to write csv

Thank you :slight_smile:

Thanks for the reply, but not on point.

The first suggestion pulls the data from a file, I want to push a CSV table with a HTTP Post.

The second, example is getting closer, but still seems to require that I pass it a file rather than just push a HTTP Post payload with the CSV.

I did find the Telegraf HTTP_LISTENER_V2 that by the brief description I think I can push the CSV to Telegraf and it will expand to Write protocol and send to influx_v2. Does that sound right?

It took a long time to pour through the long list of Telegraf plugins to discover this, and I when I have more time I’ll explore whether it can suit my needs.