The issue at hand I think is an understanding of the differences between eval and chart. eval lets you assign a value to a new field on each result (row / record) based on values of other fields in each result and functions applied to the same. Because eval works on a row by row basis, attempting to count the number of times a field is a certain value across all records isn't possible with the eval function. Additionally, eval only sets the value of a single field at a time. If you want to set multiple values you need multiple eval statements
Stats (and other functions) on the other hand lets you apply statistical functions across all records in your record set, including but not limited to count(eval(testLogic=="ADD_PASS")) as Add_Count for example. You can calculate these statistics across the record set as a whole (the default) or you can add a by clause to group over a set of other fields with the same corresponding value set for those fields allowing you to answer questions that require such division. chart is the same as stats but it let's you group by only two fields instead of arbitrarily many. The reason for this is to help you setup a visual chart with multiple series of statistics over a field containing the x-axis values. As bucketed time windows is often the preferred x-axis when it comes to data in Splunk, the timechart command is the chart command where the x-axis is simply the _time field, divided into buckets (every day, hour, minute, etc).
Now with the basics out of the way let's look at your data. For this, I'm assuming that everything before the first underscore is a parent job identifier and that time is discrete strings as is in your question. So if we do base search to retrieve data | rex field=stepName "^(?[^_]+)_" | stats count(eval(stepStatus=="PASS")) as nPass by time,parentId | eval nPass=if(nPass>0,1,0) | chart max(nPass) by parentId over time this begins to get us an approximation of what you are looking for. If time is actually _time and a Unix time stamp value instead of a discrete string, the above will change as you'll need to solve bucketing issues (for example do I have 1 or multiple runs of my overall job in my bucket,if multiple pass is that 1 or potentially 2?). also think should a partial success be counted differently or not. But I leave that as an exercise to you dear asker, and hope this early morning explanation helps
... View more