Forum Discussion
roopesh_shetty
Jun 06, 2019Copper Contributor
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.
CliveWatson
Jun 06, 2019Silver Contributor
There is an example on the logs home page
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 Perf | 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
TadasJ1825
Feb 18, 2021Copper Contributor
CliveWatson From what I understand, this does not work for Windows VMs, since they do not have the "% Used Memory" performance counter.