export-csv-to-influx icon indicating copy to clipboard operation
export-csv-to-influx copied to clipboard

TimeStamp Issues (postic/unix) 19 digits posix

Open ghost opened this issue 5 years ago • 2 comments

Seems to be unable to import 19 digit posix dates

python3 csvtoinflux.py -i server1.csv -s server5:8086 --create --dbname NewTest --tagcolumns host --fieldcolumns CPU,GPU --metricname name --timecolumn time --timeformat posix Deleting database NewTest Creating database NewTest Traceback (most recent call last): File "csvtoinflux.py", line 200, in args.timezone, args.ssl) File "csvtoinflux.py", line 78, in loadCsv datetime_naive = datetime.datetime.fromtimestamp(int(row[timecolumn])) OverflowError: timestamp out of range for platform time_t

CSV looks like this :

name,time,CPU,GPU,host temperature,1590335330162702714,53.5,53,server1 temperature,1590335335297033388,54,53,server1

ghost avatar Dec 11 '20 11:12 ghost

The relevant code is here. It would be great to have a test for this.

7yl4r avatar Jan 19 '21 16:01 7yl4r

Hello @lee-weedon

Sorry for the delay The latest lib 0.2.0 should fix your issue

Please upgrade to the latest version: pip install ExportCsvToInflux --upgrade

Bugazelle avatar Mar 12 '22 13:03 Bugazelle