# Difference of count between count of field value

**URL:** <https://discuss.elastic.co/t/difference-of-count-between-count-of-field-value/235968>\
**Category:** Elasticsearch\
**Created:** [June 5, 2020, 2:41pm UTC](https://discuss.elastic.co/t/difference-of-count-between-count-of-field-value/235968 "2020-06-05T14:41:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guillaume\_RENARD](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guillaume_renard/32/37369_2.png) [@Guillaume\_RENARD](https://discuss.elastic.co/u/Guillaume_RENARD)\
**Post date:** [June 5, 2020, 2:41pm UTC](https://discuss.elastic.co/t/difference-of-count-between-count-of-field-value/235968/1 "2020-06-05T14:41:01Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/3/a/3a76bde1e81e0ed1aca86d99a140dc40e678d8d3.png)  
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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 3, 2020, 2:41pm UTC](https://discuss.elastic.co/t/difference-of-count-between-count-of-field-value/235968/2 "2020-07-03T14:41:11Z")

</div>

Closed on July 3, 2020, 2:41pm UTC

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