Access dashboard's time range and granularity from KQL
Asked Answered
L

2

7

I've added a chart using KQL and logs from Azure Log Analytics to a dashboard. I'm using make-series which works great but the catch is the following:

The logs I'm getting might not extend to the whole time range dictated by the dashboard. So basically I need access to the starttime/endtime (and time granularity) to make make-series cover the whole timerange.

e.g.

logs
| make-series
    P90 = percentile(Elapsed, 90) default = 0,
    Average = avg(Elapsed) default = 0
    // ??? need start/end time to use in from/to
    on TimeGenerated step 1m
Lytic answered 28/3, 2021 at 22:8 Comment(0)
F
2

Currently, it's not supported. There are some feedbacks about this feature: Support for time granularity selected in Azure Portal Dashboard, and Retrieve the portal time span and use it inside the kusto query.

And some people provided workarounds in the first feedback, you can give it a try.

Fissile answered 31/3, 2021 at 6:22 Comment(3)
Look's like it's a fundamental feature that's missing. Thanks for the info.Lytic
The links are brokenAdvertent
Updated link here and it is marked as completed. However doesn't work for me feedback.azure.com/d365community/idea/…Phasia
J
0

I posted on another question on this subject - you can do a bit of a hack in your KQL to get this working: https://mcmap.net/q/1627523/-use-make-series-operator-without-defining-exact-date-range

Judaize answered 21/7, 2022 at 10:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.