# Creating a percentage metric from 2 different indexes

**URL:** <https://discuss.elastic.co/t/creating-a-percentage-metric-from-2-different-indexes/192127>\
**Category:** Kibana\
**Created:** [July 24, 2019, 7:53pm UTC](https://discuss.elastic.co/t/creating-a-percentage-metric-from-2-different-indexes/192127 "2019-07-24T19:53:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tyler\_hilsabeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tyler_hilsabeck/32/45249_2.png) [@tyler\_hilsabeck](https://discuss.elastic.co/u/tyler_hilsabeck)\
**Post date:** [July 24, 2019, 7:53pm UTC](https://discuss.elastic.co/t/creating-a-percentage-metric-from-2-different-indexes/192127/1 "2019-07-24T19:53:27Z")

</div>

Hi Everyone,

I am trying to create a metric visualization that would show me a percentage. The issue that that the values are from 2 different indexes.

Let's say the first index is called 'phishing\_emails\_reported' and the second is 'phishing\_emails\_blocked'. I want to count the number of documents in 'phishing\_emails\_reported' (lets call this x) and count the number of docs in 'phishing\_emails\_blocked' (lets call this y). I want to return the value of `1 - x/y`

I have tried using some bucket script aggregations to no avail.

Is there a way to have an aggregation fetch data from 2 different indexes or have 2 separate (sibling pipeline?) aggregations that would do this?

I believe that I can do this is timelion but I don't want a graph but rather a single percentage that I can but on a dashboard.

Thank you!

---

<div class="post-metadata">

**Author:** ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)\
**Post date:** [July 24, 2019, 9:45pm UTC](https://discuss.elastic.co/t/creating-a-percentage-metric-from-2-different-indexes/192127/2 "2019-07-24T21:45:37Z")

</div>

Hey @tyler_hilsabeck, this isn't possible until [https://github.com/elastic/kibana/issues/4707](https://github.com/elastic/kibana/issues/4707) is implemented. If you can give this a +1 or comment with your specific needs, it'll help us prioritize it appropriately.

---

<div class="post-metadata">

**Author:** ![tyler\_hilsabeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tyler_hilsabeck/32/45249_2.png) [@tyler\_hilsabeck](https://discuss.elastic.co/u/tyler_hilsabeck)\
**Post date:** [July 25, 2019, 12:42pm UTC](https://discuss.elastic.co/t/creating-a-percentage-metric-from-2-different-indexes/192127/3 "2019-07-25T12:42:16Z")

</div>

Hi @Brandon_Kobel, thank you for the help. This is something I would like to see. Specifically I would like to be able to compare data from 2 indexes.

---

<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:** [August 22, 2019, 12:45pm UTC](https://discuss.elastic.co/t/creating-a-percentage-metric-from-2-different-indexes/192127/4 "2019-08-22T12:45:53Z")

</div>

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