Forum Discussion
KQL - let statement - get an error : No tabular expression statement found
Whenever I use the "let" as below, get the error : No tabular expression statement found
Trying to figure out what I am doing wrong.
Can someone throw light on this please?
let startTime = ago(1d);
let endTime = now();
let Procdata = (
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))
Thanks
Dilip
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)
2 Replies
- Clive_WatsonBronze Contributor
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)- DilipDivgi1900Copper ContributorThanks Clive, appreciate