influxdbgraphite

Import data from CSV file to InfluxDB


I have huge data in a CSV file. I have a use case to import that CSV data to influxDB. I have 2 Linux AWS machines where Influx DB is installed in one machine and Graphite is installed in another machine. I will have my CSV data in the machine where Graphite is installed. Can someone please help me how to import data from CSV to Influx DB. I had gone through various articles for the solution. I could find the solution if both InfluxDB and Graphite is in same machine. But in my case both are in different machines.


Solution

  • I used the HTTP-API in combination with the line protocol, shoul also work for you, maybe with some reformatting

    curl -i -XPOST "http://localhost:8086/write?db=mydb" --data-binary @txtfilewithlineprotocol.csv
    

    https://docs.influxdata.com/influxdb/v1.8/tools/api/

    https://docs.influxdata.com/influxdb/v1.8/write_protocols/line_protocol_tutorial/