KQL (Kusto) to show a Graph that contains total Snapshot count over a period of time

98 Views Asked by At

I have been looking for a Kusto query that will form a graph to show the total count of snapshots over time.

Time period by 1 week gap.

Tried the below queries, but did not work. Please help. Thanks, in adv.

Snapshots
| summarize TotalSnapshots=count() by bin(Timestamp, 1w)
| render timechart

======================================================

resources
| where type == "Microsoft.Compute/snapshots"
| extend CreationDate = todatetime(properties.CreationDate)
| summarize count() by bin(CreationDate, 7d)
| render timechart

=====================================================

1

There are 1 best solutions below

4
Jahnavi On

As you are already using render operator will be used to display KQL results as a graph or bar or any other visualization.

Your code looks good to me. Alternatively, you can also use below query to achieve the requirement.

Snapshots
| summarize total = count() by bin(TimeGenerated, 1d)
| extend week = startofweek(TimeGenerated)
| project total,week
| render timechart

enter image description here