# Dividing counts of two different queries in kibana

**URL:** <https://discuss.elastic.co/t/dividing-counts-of-two-different-queries-in-kibana/101917>\
**Category:** Elasticsearch\
**Created:** [September 27, 2017, 1:12am UTC](https://discuss.elastic.co/t/dividing-counts-of-two-different-queries-in-kibana/101917 "2017-09-27T01:12:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonny\_Doe](https://avatars.discourse-cdn.com/v4/letter/j/b19c9b/32.png) [@Jonny\_Doe](https://discuss.elastic.co/u/Jonny_Doe)\
**Post date:** [September 27, 2017, 1:12am UTC](https://discuss.elastic.co/t/dividing-counts-of-two-different-queries-in-kibana/101917/1 "2017-09-27T01:12:06Z")

</div>

I am trying to create a lucene expression for displaying division on counts of two queries. Both queries contain textual information and both results are in message field. I am not sure how to write this correctly. So far what i have done is without any luck -

```
doc['message'].value/doc['message'].value

```

for first query `message` contain text as - `"404 not found"`

for second query `message` contain text as - `"500 error"`

what i want to do is `count(404 not found)/count(500 error)`

I would appreciate any help.

---

<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 25, 2017, 1:12am UTC](https://discuss.elastic.co/t/dividing-counts-of-two-different-queries-in-kibana/101917/2 "2017-10-25T01:12:17Z")

</div>

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