Mar 14 2019
07:31 AM
- last edited on
Apr 07 2022
05:43 PM
by
TechCommunityAP
Mar 14 2019
07:31 AM
- last edited on
Apr 07 2022
05:43 PM
by
TechCommunityAP
HI,
I'm new to Azure Log Analytics, so sorry or such a basic question.
From looking at this documentation https://docs.microsoft.com/en-us/azure/azure-monitor/log-query/advanced-query-writing
I should be able to create a variable using let
for example
let CPUThreshold = 5;
pref| where TimeGenerated > now(-30m)
and ObjectName == "Processor"
and CounterName == "% Processor Time"
and InstanceName == "_Total"
and CounterValue > CPUThreshold
| project Computer, ObjectName
, CounterName, CounterValue
, TimeGenerated;
I get this
I'm not sure what I'm doing wrong.
Mar 14 2019 08:08 AM - edited Mar 14 2019 08:09 AM
Solutionlet CPUThreshold = 5; Perf | where TimeGenerated > now(-30m) and ObjectName == "Processor" and CounterName == "% Processor Time" and InstanceName == "_Total" and CounterValue > CPUThreshold | project Computer, ObjectName , CounterName, CounterValue , TimeGenerated
I removed the final ";" and also you had spelled "Perf" wrongly. This now works
Mar 14 2019 10:02 AM
Thanks,
taking away the ; did it.