Is it possible to add a variable to the “from:" and "to:” section of a DQL query that is fetching logs?
Background: I have a dashboard that surfaces info from logs from a specific time of the day each morning. I want to be able to select a value in a dashboard variable that represents today, yesterday, 2 days ago, 3 days ago, etc. and have the dashboard show data for that specific time period of the chosen day.
The following DQL examples work correctly. I’d like to have a dashboard variable that changes the day being specified in the To and From sections.
Today:
- fetch logs, from: bin(now(), 1d)+ 5h + 50m, to: bin(now(), 1d) + 6h + 30m
Yesterday:
- fetch logs, from: bin(now()-1d, 1d)+ 5h + 50m, to: bin(now()-1d, 1d) + 6h + 30m
Two Days Ago:
- fetch logs, from: bin(now()-2d, 1d)+ 5h + 50m, to: bin(now()-2d, 1d) + 6h + 30m
Is this possible? What would the DQL look like?
