Hi. When you run tstats count by prefix(cod-data=) you end up getting counts for each value of cod-data. 0 <count of 0s> 1 <count of 1s> n <count of ns> And then |eval Success=if(COD_data="0" OR COD_data="", "Success", null()) |stats count(Success) as Successlogs That will identify the fields where COD_data = 0 as Success Finally the count with Count the number of rows of Success.. which = 1 So something like |tstats count where index=app-cod-idx host_ip=11.123.345.23 sourcetype=code:logs by PREFIX(cod-data=) |rename cod-data= as COD_data |where isnotnull(COD_data) | stats sum(eval(if(COD_data="0",count,0))) AS SuccessLogs, sum(eval(if(COD_data!="0",count,0))) AS FailedLogs, sum(count) as totalcount The key is that you want to sum the count
... View more