Difference of count between count of field value

Hi, I have some URLs ending by end.gif and some other by start.gif.
What I would like to get is the useragent for the one with the most start without end but I can't achieve that.
Below a screenshot

I would like a table with useragent and countof star - countof end desc meaning the first agent displayed whould be the one with the less end (so the worst). I need this info to know where the most work is needed.
I'm trying with sql in kibana with no luck, I can also use scripted field but no sure how I can do that with two different counts

Thanks for your help.
Best regards

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