Mark Morris
Mark Morris

Reputation: 81

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

Upvotes: 4

Views: 17529

Answers (1)

beckettsean
beckettsean

Reputation: 1846

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?

Upvotes: 1

Related Questions