0
votes

I am trying to fetch underutilized computers in Azure. I am trying to use OMS Log Analytics query for this.

The query returns the Azure VMs and on-premise servers as well (fetched via SCOM or direct agent). I need to filter the result to get only the Azure VMs. What is the best way (or query) to fetch only Azure computers in OMS Log Analytics Search Query?

I know that I need to create a Computer Group and then use that Computer Group in my Query as shown below.

Type=Perf ObjectName=Processor CounterName="% Processor Time" Computer IN $ComputerGroups[AzureComputers]

I need to know what Query should I use to create the Computer Group "AzureComputers" which is used in the above query.This computer group will contain only computers which are present in Azure i.e. which are Azure VMs.

1
pretty sure this has nothing to do with stackoverflow4c74356b41
@4c74356b41 It is related to Azure tag. I have asked similar questions, related to azure tag here before as well. Why do you think it is not related to StackOverflow. I can post this in a different forum if you still think this does not belong here and knows a more appropriate forum for this. I see similar questions on StackOverflow here: stackoverflow.com/questions/tagged/azureAman Sharma

1 Answers

0
votes

This feature is now provided out of the box in OMS Log Analytics. Finding Azure computers is as easy as running below query in Log Analytics:  

Heartbeat | where ComputerEnvironment == "Azure" and notempty(ResourceId) | distinct Computer