Forum Discussion

DurgaPrasad635's avatar
DurgaPrasad635
Copper Contributor
Jul 11, 2022
Solved

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...
  • Clive_Watson's avatar
    Clive_Watson
    Jul 12, 2022

    DurgaPrasad635 

     

    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 

     

    Go to Log Analytics and run query