jpillora / csv-to-influxdb

Import CSV files into InfluxDB
80 stars 37 forks source link

No records inserted - Done (wrote 0 points) #23

Closed george-marcel closed 7 years ago

george-marcel commented 7 years ago

I have the following data in sdw04_sar01.csv timestamp,CPU,usr,nice,sys,iowait,steal,irq,soft,guest,idle 2017-09-01 00:10:03,all,1.68,30.10,11.01,9.85,0.00,0.00,1.85,0.00,45.50 2017-09-01 00:20:03,0,2.34,43.17,19.91,22.29,0.00,0.01,3.71,0.00,8.58 2017-09-01 00:30:03,1,2.02,39.22,17.69,10.56,0.00,0.01,3.72,0.00,26.78 2017-09-01 00:40:03,2,2.02,38.08,17.59,9.51,0.00,0.01,3.53,0.00,29.25 2017-09-01 00:50:03,3,1.88,37.12,16.04,9.09,0.00,0.01,4.41,0.00,31.45 2017-09-01 01:00:03,4,1.93,37.20,15.48,7.75,0.00,0.01,2.98,0.00,34.66 2017-09-01 01:10:03,5,1.45,39.87,13.89,7.12,0.00,0.01,2.68,0.00,34.99 2017-09-01 01:20:03,6,1.54,37.00,13.89,7.41,0.00,0.01,3.24,0.00,36.91 2017-09-01 01:30:03,7,1.33,35.53,14.10,8.09,0.00,0.01,4.09,0.00,36.85 2017-09-01 01:40:03,8,1.49,36.31,13.67,7.37,0.00,0.00,2.67,0.00,38.49 2017-09-01 01:50:03,9,1.42,35.63,13.34,7.55,0.00,0.01,2.84,0.00,39.21

When I execute - csv-to-influxdb -d test sdw04_sar01.csv

2017/09/09 02:22:05 Done (wrote 0 points)

Is there something wrong? Is there a way to debug?

EEShaffer commented 7 years ago

Hi,
I think I remember having that problem as well. Mine might have been caused by nulls in the data. What command are you using? This command helped me: csv-to-influxdb -d=test -m=h2o_feet -tf='YYYY-MM-DD hh24:mi:ss.ff9' -ts=dateFrom -ts=dateTo --treat-null -f /datadirectory/file_name.csv

george-marcel commented 7 years ago

Thanks Shaffer. It worked after I set the time format to '2017-09-01 00:00:00'. Looks like -tf is mandatory.