Forum Discussion
tipper1510
Dec 18, 2023Brass Contributor
Use of TimeRange parameter in workbooks
Hi, I use the timerange parameter as: | where Timestamp >= {TimeRange:start} and TimeGenerated <= {TimeRange:end} but need to incorporate into: | where Timestamp between ( startofday(...
tipper1510
Dec 18, 2023Brass Contributor
Hi Clive,
I need to use the TimeRange parameter with the 14d ago and 7ago as need to get the previous weeks data for comparison but ensure I use the supplied initial TimeRange.
Regards,
Tim
I need to use the TimeRange parameter with the 14d ago and 7ago as need to get the previous weeks data for comparison but ensure I use the supplied initial TimeRange.
Regards,
Tim
Clive_Watson
Dec 18, 2023Bronze Contributor
Is this the type of result (using the Microsoft demo data), very simplified.
Go to Log Analytics and run query
// arg0
let last30days=
Heartbeat
| where TimeGenerated between( ago(30d) .. now() )
| summarize //min(TimeGenerated), max(TimeGenerated)
count()
by bin(TimeGenerated,1d)
;
//arg1
let last7days=
Heartbeat
| where TimeGenerated between( ago(14d) .. ago(7d) )
| summarize //min(TimeGenerated), max(TimeGenerated)
count()
by bin(TimeGenerated,1d)
;
union withsource=sourceTable last30days, last7days
| render columnchart
- tipper1510Dec 18, 2023Brass ContributorHi Chris,
Thanks for the reply's.
I think so 🙂
Need to be able to define TimeRange:start 14 days ago and TimeRange:end 7 days ago as my defined time period. As when certain workbooks are used exact dates and times are used in the TimeRange parameter.
Regards,
Tim