I have some iot data in csv format that I would like to push into InfluxDb.
I am using influx write from the command line, but I am getting a parsing error back.
The command I’m running is
influx write -b iotData \
-f data.csv \
--header "#constant measurement,iotdata" \ --header "#datatype dateTime:RFC3339Nano,long,long,long,long" --format csv
My Data looks like this:
date,temp,humidity,light,voltage
2004-03-31 03:38:15,122.153,-3.91901,11.04,2.03397
2004-02-28 00:59:16,19.9884,37.0933,45.08,2.69964
2004-02-28 01:03:16,19.3024,38.4629,45.08,2.68742
2004-02-28 01:06:16,19.1652,38.8039,45.08,2.68742
2004-02-28 01:06:46,19.175,38.8379,45.08,2.69964
2004-02-28 01:08:45,19.1456,38.9401,45.08,2.68742
2004-02-28 01:09:22,19.1652,38.872,45.08,2.68742
2004-02-28 01:09:46,19.1652,38.8039,45.08,2.68742
2004-02-28 01:10:16,19.1456,38.8379,45.08,2.69964
2004-02-28 01:10:46,19.1456,38.872,45.08,2.68742
2004-02-28 01:11:46,19.1456,38.9401,45.08,2.69964
2004-02-28 01:12:46,19.1358,38.9061,45.08,2.68742
2004-02-28 01:14:16,19.1162,38.8039,45.08,2.69964
2004-02-28 01:14:46,19.1162,38.872,45.08,2.69964
2004-02-28 01:15:16,19.1064,39.0082,45.08,2.69964
2004-02-28 01:16:16,19.1064,38.872,43.24,2.69964
2004-02-28 01:16:46,19.0966,38.8039,43.24,2.69964
The error response I’m getting is:
unable to parse ‘iotdata date=2004-02-28 19:42:48,temp=20.4098,humidity=37.8477,light=45.08,voltage=2.69964’: invalid number
unable to parse ‘iotdata date=2004-02-28 19:43:20,temp=20.4098,humidity=37.9161,light=45.08,voltage=2.69964’: invalid number
unable to parse ‘iotdata date=2004-02-28 19:44:17,temp=20.4,humidity=37.9161,light=45.08,voltage=2.69964’: invalid number
unable to parse ‘iotdata date= --header’: missing field value
I have tried specifying other formats other than long etc, but still the error remains.
Please can someone shed some light on why this is happening?