azure - Log Analytics 将流程实例分组为一个流程名称

标签 azure azure-log-analytics azure-data-explorer kql

我正在运行以下查询,它返回服务的多个实例,例如 firefox 和 firefox#1 firefox#2。

当我显示图表时,我会看到多行而不是单个 Firefox 行,所有 3 个实例的平均值合为一个。

Perf

| where InstanceName 
has "firefox" 
and CounterValue > 0

| summarize ProcessorUsage = avg(CounterValue)
by bin(TimeGenerated, 
5m), InstanceName 

因此,与其返回 firefox#1 和 firefox#2,不如对所有 3 个的平均值进行分组。

我希望能够查看虚拟机上每个进程的 CPU 使用情况,而不是查看同一应用程序的多个实例。

最佳答案

更新 0809: 添加另一个实例,例如 chrome

Perf 
| where  (InstanceName has "firefox" and CounterValue >0) or (InstanceName has "chrome" and CounterValue >0)
| extend new_InstanceName = iif(InstanceName has "firefox", "firefoxavg","chromeavg" ) 
| summarize ProcessorUsage = avg(CounterValue) by bin(TimeGenerated, 5m), new_InstanceName
<小时/>

您可以为包含“firefox”的记录添加一个新列(使用扩展运算符),然后在摘要句子中使用新列。

代码如下:

Perf
| where InstanceName has "firefox" and CounterValue > 0
| extend new_InstanceName ="firefoxavg"
| summarize ProcessorUsage = avg(CounterValue) by bin(TimeGenerated, 5m), new_InstanceName

关于azure - Log Analytics 将流程实例分组为一个流程名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57407617/

相关文章:

azure - 此 Azure Graph Kusto 中的 'data' 表来自哪里?

Azure数据资源管理器将动态列中的guid字符串转换为小写

api - 如何在 Azure APIM 中获取 API 的订阅者 ID?

azure - 需要在azure服务中使用appsettings

Azure Workbooks 条形图不会像 azure 分析日志查询那样按第三列值拆分数据

Azure Log Analytics 解析字符串

azure - 在 Azure 数据资源管理器上根据条件删除行

azure - Spark - 如何从数据帧列中获取带有父文件夹的文件名

node.js - Azure 网站上提供哪些版本的 node.js?

azure - 当 Kusto 中的数据存在间隙时,仅使用连续数据集并切断数据