{"id":8990,"date":"2025-06-27T01:54:53","date_gmt":"2025-06-27T01:54:53","guid":{"rendered":"https:\/\/pariswells.com\/blog\/?p=8990"},"modified":"2025-06-27T01:54:55","modified_gmt":"2025-06-27T01:54:55","slug":"kql-custom-logic-to-get-diskspace-for-vm-in-azure-over-75-used","status":"publish","type":"post","link":"https:\/\/pariswells.com\/blog\/research\/kql-custom-logic-to-get-diskspace-for-vm-in-azure-over-75-used","title":{"rendered":"KQL Custom Logic to get Diskspace for VM in Azure over 75% Used"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code class=\"\">InsightsMetrics\n| where Namespace == \"LogicalDisk\"\n| where Name == \"FreeSpacePercentage\"\n| where TimeGenerated > ago(5m)\n| extend Disk=tostring(todynamic(Tags)[\"vm.azm.ms\/mountId\"])\n| extend UsedSpacePercentage = 100 - Val\n| summarize arg_max(TimeGenerated, *) by Disk, Computer\n| project TimeGenerated, Disk, Computer, UsedSpacePercentage\n| where UsedSpacePercentage > 25<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-8990","post","type-post","status-publish","format-standard","hentry","category-research"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/8990","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/comments?post=8990"}],"version-history":[{"count":1,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/8990\/revisions"}],"predecessor-version":[{"id":8991,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/8990\/revisions\/8991"}],"wp:attachment":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/media?parent=8990"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/categories?post=8990"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/tags?post=8990"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}