Forum Discussion
DurgaPrasad635
Jul 11, 2022Copper Contributor
Need help with log analytics query for API failure percentage
Hi, I am trying to get API management service failure percentage in Log analytics, but not getting anywhere. Can anyone please help in this ? something like below I tried but no luck, still l...
- Jul 12, 2022
Yes, just add this. I did add a filter so only entries above 1% are shown (in the test data I get a lot below that...you may want all of them or another number)
let totalreq = toscalar(AppRequests | count); AppRequests | summarize failure_percentage =countif(Success=='False') / todouble(totalreq) * 100 by OperationName | where failure_percentage > 1 | render barchart
DurgaPrasad635
Jul 12, 2022Copper Contributor
Thanks this helped me!
Is it possible to get OperatonName which is failed ? just tryint to create a dashboard.
Thanks
Clive_Watson
Jul 12, 2022Bronze Contributor
Yes, just add this. I did add a filter so only entries above 1% are shown (in the test data I get a lot below that...you may want all of them or another number)
let totalreq = toscalar(AppRequests
| count);
AppRequests
| summarize failure_percentage =countif(Success=='False') / todouble(totalreq) * 100 by OperationName
| where failure_percentage > 1
| render barchart