You have an Azure subscription. You deploy the Azure Monitor agent to virtual machines that run Windows Server. All performance counters are collected and sent to a Log Analytics workspace named Workspace1.
Workspace1 is configured with the default data retention period of days.
You need to analyze the average CPU utilization for the virtual machines over the last days. The results must show only computers with an average CPU utilization greater than and be sorted from the highest utilization to the lowest.
Which action and query should you select to meet these requirements?
- AChange the data retention of Workspace1 to days, and run the following query:
kql
Perf
| where TimeGenerated > ago(45d) and ObjectName == "Processor" and CounterName == "% Processor Time" and InstanceName == "_Total"
| where AvgCPU > 90
| summarize AvgCPU = avg(CounterValue) by Computer
| sort by AvgCPU desc - Change the data retention of Workspace1 to days, and run the following query:
kql
Perf
| where TimeGenerated > ago(45d)
| where ObjectName == "Processor" and CounterName == "% Processor Time" and InstanceName == "_Total"
| summarize AvgCPU = avg(CounterValue) by Computer
| where AvgCPU > 90
| sort by AvgCPU desc
Cevap - CKeep the default data retention of Workspace1, and run the following query:
kql
Perf
| where TimeGenerated > ago(45d)
| where ObjectName == "Processor" and CounterName == "% Processor Time" and InstanceName == "_Total"
| summarize AvgCPU = avg(CounterValue) by Computer
| where AvgCPU > 90
| sort by AvgCPU desc - DChange the data retention of Workspace1 to days, and run the following query:
kql
Perf
| where TimeGenerated > ago(45d)
| where ObjectName = "Processor" and CounterName = "% Processor Time" and InstanceName = "_Total"
| summarize AvgCPU = avg(CounterValue) by Computer
| where AvgCPU > 90
| order by AvgCPU desc
Cevap
Change the data retention of Workspace1 to days, and use the query that places the aggregation filter after the summarize operator and uses double equals for comparisons.
The correct answer combines increasing the data retention to days with a syntactically correct KQL query. The query uses double equals (`==`) for comparisons, correctly aggregates the CPU counters by computer, and applies the `AvgCPU` threshold filter after the column has been created by the `summarize` operator.
Adım Adım Çözüm
Anahtar Kavram
Log Analytics workspace data retention limitations and formulating syntactically correct KQL queries utilizing proper operator order and comparison operators.
Tahmini Süre:3m 0s