Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

InfluxDB data input file timestamp format

Trying to load some sample data into InfluxDB and had a question about the timestamp format.

I have two files in the first the timestamp (epoch) is in second precision e.g. 1439856000 and loading the file via curl the timestamp is interpreted correctly. The second file has the timestamp in the same format, but when the data is loaded into Influx the timestamp looks like

1970-01-01T00:00:01.429856Z

It appear it their is a mismatch in the precision and to get Influx to interpret it correctly I need to add 7 zeros to the end of the timestamp in the second file.

I don't understand why influx treats the timestamp in each file differently, since they are in exactly the same format in each time and loaded using the same method, is there a setting for time precision for the database which I have missed.

Mark

like image 467
Mark Morris Avatar asked Feb 18 '26 11:02

Mark Morris


1 Answers

Another InfluxDB user hit the same issue in this SO question: Post simple value in InfluxDB. Precision for timestamps is assumed to be nanoseconds unless otherwise specified. The 1970-01-01T00:00:01.429856Z date is 1429856000 nanoseconds, which is likely the timestamp supplied with seconds precision.

When using curl, the precision is specified as a query string parameter, as described here: https://influxdb.com/docs/v0.9/write_protocols/write_syntax.html#http

I can't say why the two files would load with different precision. Can you please share the actual curl commands?

like image 85
beckettsean Avatar answered Feb 21 '26 15:02

beckettsean



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!