Skip to content
Related Articles

Related Articles

Microsoft Azure – KQL Query to Get the VM Computer Properties

View Discussion
Improve Article
Save Article
Like Article
  • Last Updated : 21 Feb, 2022

In this article, we will be using the KQL queries to fetch the data ingested logs from Azure Monitor or Azure Log Analytics Workspace to get the complete details or properties of the Azure Server across subscriptions at once using the simple KQL queries. Let’s get started.

VMComputer is a  KQL Operator to collect Inventory data for servers by the Service Map and VM Insights solutions using the Dependency agent and Log analytics agent.

1. KQL Query to get the Azure VM Server Details 

VMComputer
| where TimeGenerated > ago(1h)

Output returns the complete details of VMComputer Properties.

Sample Output:

2. KQL Query to get the Azure VM Server properties of Operating System Details like OS Type, OS Full Name 

VMComputer
| where TimeGenerated > ago(1h)
| summarize by Computer, OperatingSystemFamily, OperatingSystemFullName

Output returns the Computer – Name of the Server, OperatingSystemFamily – Value will be windows or linux, OperatingSystemFullName – The full name of the operating system.

Sample Output:

3. KQL Query to get the Azure VM Server properties of Azure VM Size and the number of CPUs.

VMComputer
| where TimeGenerated > ago(1h)
| summarize by Computer, AzureSize, Cpus

Output returns the Computer – Name of the Server, AzureSize – The size of the Azure VM, Cpus – The number of CPUs

Sample Output:

4. KQL Query to get the Azure VM Server properties of IPv4 Address, IPv4 Default Gateway, and IPv4 Subnet Mask.

VMComputer
| where TimeGenerated > ago(1h)
| summarize by Computer, tostring(Ipv4Addresses), tostring(Ipv4DefaultGateways), tostring(Ipv4SubnetMasks)

Output returns the Computer – Name of the Server, Ipv4Addresses -A list of the server’s IPv4 addresses, Ipv4DefaultGateways – A list of the server’s IPv4 default gateways. Ipv4SubnetMasks – A list of the server’s IPv4 subnet masks.

Sample Output:

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!