Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InfluxDB 2.0: range specified as an epoch time doesn't work [flux] #1205

Closed
bednar opened this issue Apr 23, 2019 · 4 comments
Closed

InfluxDB 2.0: range specified as an epoch time doesn't work [flux] #1205

bednar opened this issue Apr 23, 2019 · 4 comments

Comments

@bednar
Copy link

bednar commented Apr 23, 2019

When I trying get data by:

from(bucket: "my-bucket")
  |> range(start: 0)
  |> last()

the result is without records. But If i trying get data by:

from(bucket: "my-bucket")
  |> range(start: 1970-01-01T00:00:00.000000001Z)
  |> last()

the result contains records.

Is the syntax with an epoch time still supported?

@sanderson
Copy link
Contributor

@bednar Currently, Flux only supports RFC3339 timestamps (noted in the docs), but other formats may be supported in the future.

@bednar
Copy link
Author

bednar commented Apr 23, 2019

ok, thx @sanderson

@bednar bednar closed this as completed Apr 23, 2019
@geoff-nunan
Copy link

Is it possible to define a custom flux function that converts epoch to RFC3339?
This issue is a problem because Grafana uses epoch for it's built-in time variables that can be passed into the flux query.

@sanderson
Copy link
Contributor

@bednar @geoff-nunan You should now be able to do this using the time() function. It will convert an epoch nanosecond timestamp into an RFC3339 timestamp. It must be a nanosecond precision timestamp however.

from(bucket: "example-bucket")
  |> range(start: time(v: 1566479392378544000))
  ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants