Query for Percent Memory Used


Hi Guys,

Can someone give me the azure log analytics Query which will provide me the Memory (RAM) usage in percentage (Percent Memory Used) of all Virtual machines.

2 Replies



There is an example on the logs home page

Annotation 2019-06-06 195310.jpg


It does have CPU info as well, but if you edit that out you have:


// Memory usage
// Chart all computers' used memory  over the last hour
| where TimeGenerated > ago(1h)
| where  CounterName == "% Used Memory" 
| project TimeGenerated, CounterName, CounterValue 
| summarize avg(CounterValue) by CounterName, bin(TimeGenerated, 1m)
| render timechart

Note: you have to collect "% Used Memory"  in log Analytics https://docs.microsoft.com/en-us/azure/azure-monitor/platform/data-sources-performance-counters

@Clive Watson From what I understand, this does not work for Windows VMs, since they do not have the "% Used Memory" performance counter.