DQL
Questions about Dynatrace Query Language
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Result in Percentage of service in a single query

kumarv14
Participant

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

 

@krzysztof_hoja 

 

 

3 REPLIES 3

kumarv14
Participant

@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 .

 
 

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:

krzysztof_hoja_0-1769450664891.png

 

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}

kumarv14_0-1769771167383.png

Thanks 

Featured Posts