Forum Discussion
KQL - let statement - get an error : No tabular expression statement found
- Feb 02, 2022
Change the last lines to:
by Computer, bin(TimeGenerated, 1h));
Procdata
You would get the same result with:
let startTime = ago(1d);
let endTime = now();
Perf
| where TimeGenerated between(startTime .. endTime)
| where CounterName == "% Processor Time"
| where ObjectName == "Processor"
| where InstanceName == "_Total"
| summarize PctCpuTime = avg(CounterValue)
by Computer, bin(TimeGenerated, 1h)
Change the last lines to:
by Computer, bin(TimeGenerated, 1h));
Procdata
You would get the same result with:
let startTime = ago(1d);
let endTime = now();
Perf
| where TimeGenerated between(startTime .. endTime)
| where CounterName == "% Processor Time"
| where ObjectName == "Processor"
| where InstanceName == "_Total"
| summarize PctCpuTime = avg(CounterValue)
by Computer, bin(TimeGenerated, 1h)