简体   繁体   English

如何在OMS Log Analytics搜索查询中仅访存Azure计算机

[英]How to Fetch only Azure Computers in OMS Log Analytics search query

I am trying to fetch underutilized computers in Azure. 我正在尝试在Azure中获取未充分利用的计算机。 I am trying to use OMS Log Analytics query for this. 我正在尝试为此使用OMS Log Analytics查询。

The query returns the Azure VMs and on-premise servers as well (fetched via SCOM or direct agent). 该查询还返回Azure VM和本地服务器(通过SCOM或直接代理获取)。 I need to filter the result to get only the Azure VMs. 我需要过滤结果以仅获取Azure VM。 What is the best way (or query) to fetch only Azure computers in OMS Log Analytics Search Query? 在OMS Log Analytics搜索查询中仅获取Azure计算机的最佳方法(或查询)是什么?

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 ie which are Azure VMs. 我需要知道使用什么查询来创建用于上述查询的计算机组“ AzureComputers ”。该计算机组将仅包含Azure中存在的计算机,即Azure VM。

This feature is now provided out of the box in OMS Log Analytics. 现在可以在OMS Log Analytics中立即使用此功能。 Finding Azure computers is as easy as running below query in Log Analytics: 查找Azure计算机就像在Log Analytics中的查询下面运行一样容易:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM