16 Jan 2026
11:51 AM
- last edited on
19 Jan 2026
07:54 AM
by
MaciejNeumann
i wants to check % of success and failure in my query these are (0","1","200","1001","2001","5001","5450")success code rest are all error code , so how can i get % of service in succes and failure respectively .
with this query i am achhieving counts of error code ,so it possible to get success and failure counts with % of success and failed one . Please help me to resolve this issue .
fetch logs,scanLimitGBytes:-1
| filter dt.system.bucket=="engineering" and index == "db"
| filter Market == "IND"
| filter not in (ResultCode,array ("0","1","200","1001","2001","5001","5450"))
| summarize count(),by:{TransactionType,ResultCode,ApiName}
|dedup TransactionType
16 Jan 2026 12:30 PM
@krzysztof_hoja could you please check my table data which one are for success and failure respectively i wants in a single table % of success and failure with counts of total and failed .
26 Jan 2026 06:04 PM
I hope this example explains how to do this:
data
record(ResultCode="0", TransactionType="A"),
record(ResultCode="0", TransactionType="A"),
record(ResultCode="0", TransactionType="A"),
record(ResultCode="1", TransactionType="A"),
record(ResultCode="0", TransactionType="B"),
record(ResultCode="1", TransactionType="B"),
record(ResultCode="0", TransactionType="B"),
record(ResultCode="1", TransactionType="B")
| summarize { ci=countIf(in(ResultCode,{"1"})),
c = count() }, by: {TransactionType}
| fieldsAdd p = 100.0*ci/c
Result looks like this:
30 Jan 2026 11:08 AM
Hello ,
I wants to check these counts in last 7 days but wants days in column and hours in row side , how is it possible ? currently using below query .
fetch logs, scanLimitGBytes:-1
| filter dt.system.bucket=="custom" and index == "db"
| filter Market=="India"
| filter TransactionType == "Authentication"
|fieldsAdd Date = formatTimestamp(timestamp, format: "yyyy-MM-dd: hh" )
|summarize count() ,by:{Date}
Thanks
Featured Posts