Percentile calculation using two fields and condition

Hi All,

I am trying to calculate the percentile of success rate, using 2 fields count on one condition.

Expl : I have 1000 hits

Fields are

time difference, flag, name

I need to calculate in the below format, Please suggest me how to do it in Elasticsearch/Kibana/Grafana

Success Rate Percentile = (count(time difference <=5 AND flag=Y)/count(*))*100

Thanks In Advance

A scripted percentiles agg might work for you. You can access the time_difference and flag field in the script and emit whatever values you need.

Can you describe the output a bit more, maybe give an example? The "Success Rate Percentile" equation doesn't look like a percentile, more like an average?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.