This should do it:
<base search> | eval SLA = if(secs < 51, 1, 0) | stats count as TOTAL, sum(SLA) as SLA | eval percentage_success = (SLA / TOTAL) * 100
Here's the breakdown:
eval SLA = if(secs < 51, 1, 0) => This will provide an SLA field with a 1 if it's within SLA, and 0 if it's outside SLA
stats count as TOTAL, sum(SLA) as SLA => This will provide the total count of events, by simply counting them, at the same time as "counting" the number of events within SLA. It will also consolidate the data into a single row
eval percentage_success = (SLA / TOTAL) * 100 => This will provide the percentage that you were looking for.
If you are interested in only displaying the percentage value, then you can add | fields percentage_success to the end of the search I gave you.
Hope this helps
... View more