Log Analytics - Render Timechart of all VMs and their disks

Chris Peacock 1 Reputation point
2023-01-03T12:56:37.807+00:00

Hi,

I'm currently using this KQL to show the %age of disk space per computer, and each disk they have.

InsightsMetrics
| where TimeGenerated > ago(24h)
| where Origin == "vm.azm.ms"
| where Namespace == "LogicalDisk" and Name == "FreeSpacePercentage"
| extend Disk=tostring(todynamic(Tags)["vm.azm.ms/mountId"])
| summarize AggregatedValue = avg(Val) by bin(TimeGenerated, 1m), Computer, _ResourceId, Disk

I'd like this in a time chart, but when I simply add | render timechart is only shows what must be the total of all disks per computer

275639-image.png

How do I show each disk of each computer in a timechart?

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,658 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Andrew Blumhardt 10,051 Reputation points Microsoft Employee
    2023-01-03T13:43:29.223+00:00

    That is a lot of data points for one chart. Maybe something like this:

    InsightsMetrics
    | where TimeGenerated > ago(24h)
    | where Origin == "vm.azm.ms"
    | where Namespace == "LogicalDisk" and Name == "FreeSpacePercentage"
    | where parse_json(Tags).["vm.azm.ms/mountId"] matches regex "[A-Z]:"
    | extend Disk=strcat(Computer, " ", parse_json(Tags).["vm.azm.ms/mountId"])
    | summarize count() by bin(TimeGenerated, 10m), Disk, Val
    | render timechart


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.