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

Time selection macros in query parameters #17

Closed
Vamic opened this issue Nov 29, 2020 · 4 comments · Fixed by #22
Closed

Time selection macros in query parameters #17

Vamic opened this issue Nov 29, 2020 · 4 comments · Fixed by #22
Labels
type/feature-request Requested new feature or enhancement

Comments

@Vamic
Copy link

Vamic commented Nov 29, 2020

Many data sources have the $__timeFrom() and $__timeTo() macros, is it possible to add those?

I need the format in epoch for my integration but i imagine there would be many APIs that use different formats so maybe $__timeFrom("format") would be appropriate?

@marcusolsson
Copy link
Contributor

marcusolsson commented Nov 30, 2020

Most of the built-in data sources also support $__unixEpochFrom(), $__unixEpochTo(). Since it covers your use case, and since many people are already used to them, maybe we can start there?

I'm thinking maybe we could add it to the queries even, to be able to filter even if the API doesn't support it. Something like:

$.items[?(@.created_at > $__unixEpochTo() && @.created_at < $__unixEpochFrom())].name

@marcusolsson marcusolsson added the type/feature-request Requested new feature or enhancement label Nov 30, 2020
@marcusolsson
Copy link
Contributor

@Vamic Would #22 solve your use case?

@Vamic
Copy link
Author

Vamic commented Dec 3, 2020

Yep, that should be perfect. 👍

@marcusolsson
Copy link
Contributor

Available now in v0.7.0! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature-request Requested new feature or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants