__Proposal:__ Allow where clause to filter on time window (without date)
__Current behavior:__ Absolute and relative timestamps can be selected as a whole (date + time)
__Desired behavior:__ Query specific time window over several days
__Use case:__ Calculating sum or average of metric in specific hours over several days, for example average cpu usage in working hours (9 to 17) throughout a week. Or sum of web server requests in morning hours (9 to 12) in a month.
This can be currently achieved using external scripts for filtering, to generate absolute time window for desired period, execute query and aggregate the results. But it would be usefull if it could be done internally.
Example usage:
SELECT "filed" FROM "measure" WHERE $timeFilter AND hour(time) >= 9 AND hour(time) <= 17 GROUP BY time(1h)
Similar functionality (although through lambda functions) is implemented in Kapacitor: https://docs.influxdata.com/kapacitor/v1.2/tick/expr/#time-functions
It should be great +100
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hey stalebot, we still want this but haven't had a single reply from the actual developers :(
Hey stalebot, we still want this but haven't had a single reply from the actual developers :(
@vithu92
This issue is being worked on as I write this!
any idea when this will be out?
This would be lovely to have, it's pretty hard to make a good histogram without being able to select a time window like this.
Also waiting on this.
The hourSelection() Flux function was added in Flux 0.39 and _should_ roll out with the release of InfluxDB 1.7.9.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Oh, good to see that this repo has continued to employ the unmitigated disaster of stalebot....
The bot that takes long-standing issues, and swishes them under the rug :|
So I guess where back to doing this:
Any updates on this, is very much needed!
Flux makes this possible with the hoursSelection() function.
https://v2.docs.influxdata.com/v2.0/reference/flux/stdlib/built-in/transformations/hourselection/
great @sanderson .
Do you know when the 2.0 stable release ?
@Nibeck1309, the best I can offer is "soon" 馃槃, but you don't need InfluxDB 2.0 to use Flux. With InfluxDB 1.8, Flux support is considered stable. You just need to enable Flux in your InfluxDB configuration file: https://docs.influxdata.com/flux/v0.65/introduction/installation/
@sanderson, just clarifying, so this feature won't be supported by InfluxQL?
thanks
@Nibeck1309 InfluxDB 2.0 is going GA very soon. I don't know the exact date, but stay tuned over the next couple of days. We're on release candidate 3 for the 2.0 GA build.
@aswinzaa No, it is very unlikely that this functionality will be added to InfluxQL.
Most helpful comment
Oh, good to see that this repo has continued to employ the unmitigated disaster of stalebot....
The bot that takes long-standing issues, and swishes them under the rug :|
So I guess where back to doing this:
Bump