# Sum logs that fit a query and make a calculation on it

**URL:** <https://discuss.elastic.co/t/sum-logs-that-fit-a-query-and-make-a-calculation-on-it/100861>\
**Category:** Kibana\
**Created:** [September 18, 2017, 11:02am UTC](https://discuss.elastic.co/t/sum-logs-that-fit-a-query-and-make-a-calculation-on-it/100861 "2017-09-18T11:02:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomer](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@tomer](https://discuss.elastic.co/u/tomer)\
**Post date:** [September 18, 2017, 11:02am UTC](https://discuss.elastic.co/t/sum-logs-that-fit-a-query-and-make-a-calculation-on-it/100861/1 "2017-09-18T11:02:17Z")

</div>

Hi,  
How can I count the amount of logs that the term 'delay' is between 3 and infinity and afterwards subtract from that 100...  
The tricky part is showing it in a visualization.  
Help will be great

---

<div class="post-metadata">

**Author:** ![pranav0091](https://avatars.discourse-cdn.com/v4/letter/p/cab0a1/32.png) [@pranav0091](https://discuss.elastic.co/u/pranav0091)\
**Post date:** [September 18, 2017, 5:26pm UTC](https://discuss.elastic.co/t/sum-logs-that-fit-a-query-and-make-a-calculation-on-it/100861/2 "2017-09-18T17:26:29Z")

</div>

Isn't that the same as showing a normalised (ie, maximum-100) plot of all the logs that have the term delay between 0 and 2?

To do that you can use a filter (Kibana 5.6.0 and later) - Click Line plots or Vertical bar graphs \> Plot as usual\> Click on Add a filter and choose the field of interest and set the appropriate value (in this case say `is between` 0 to 2).  
Then go to Metrics And Axes and under the heading Y-axis change the mode from normal to `Percentage`

Can you see if that works for you?

---

<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:** [October 16, 2017, 5:26pm UTC](https://discuss.elastic.co/t/sum-logs-that-fit-a-query-and-make-a-calculation-on-it/100861/3 "2017-10-16T17:26:43Z")

</div>

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