# Creating metric visualization with sum of top10 hits

**URL:** <https://discuss.elastic.co/t/creating-metric-visualization-with-sum-of-top10-hits/211139>\
**Category:** Kibana\
**Created:** [December 9, 2019, 2:33pm UTC](https://discuss.elastic.co/t/creating-metric-visualization-with-sum-of-top10-hits/211139 "2019-12-09T14:33:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahoffskov](https://avatars.discourse-cdn.com/v4/letter/a/a9adbd/32.png) [@ahoffskov](https://discuss.elastic.co/u/ahoffskov)\
**Post date:** [December 9, 2019, 2:33pm UTC](https://discuss.elastic.co/t/creating-metric-visualization-with-sum-of-top10-hits/211139/1 "2019-12-09T14:33:10Z")

</div>

Hello all, new user of the ELK platform here.

I'm importing results from a Nessus-scanner, which I then present on a dashboard in order for different departments to use as a "How are we doing in securing the environment".

I have a data table showing vulnerabilites sorted by no. of occurences. With a KPI defined as "A 75% reduction in Top10 Critical/High Risk at the end of ", I would like to create a metric showing the sum of the top10 occurences.  
Example:  
Vulnerability 1: 75 unique hosts  
Vulnerability 2: 50 unique hosts  
Vulnerability 3: 49 unique hosts  
...  
Vulnerability 10: 20 unique hosts  
SUM: X unique hosts

Sum : Y unique hosts

I believe the key here would be summing the Unique Count, but only for top10 - any ideas?

---

<div class="post-metadata">

**Author:** ![markov00](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/markov00/32/33316_2.png) [@markov00](https://discuss.elastic.co/u/markov00)\
**Post date:** [December 30, 2019, 8:58am UTC](https://discuss.elastic.co/t/creating-metric-visualization-with-sum-of-top10-hits/211139/2 "2019-12-30T08:58:15Z")

</div>

Hi @ahoffskov  
Welcome to our community and sorry for the long delay in getting a reply.  
Have you found a valid solution to your problem?  
If not I think you can achieve that with an horizontal bar chart (it will allows you to show the ranking and to compare the values) with a configuration like the following:

- as metric you can use an unique count of hosts
- as bucket you can use a term aggregation on the vulnerability id/name

If you tweak the bucket size to 10, you will get the top 10 vulnerability by unique host count.

---

<div class="post-metadata">

**Author:** ![ahoffskov](https://avatars.discourse-cdn.com/v4/letter/a/a9adbd/32.png) [@ahoffskov](https://discuss.elastic.co/u/ahoffskov)\
**Post date:** [January 12, 2020, 9:05pm UTC](https://discuss.elastic.co/t/creating-metric-visualization-with-sum-of-top10-hits/211139/3 "2020-01-12T21:05:51Z")

</div>

I apologize for my long response time. Had to get a PoC up and running. I will try this and get back with an answer 🙂

---

<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:** [February 9, 2020, 9:05pm UTC](https://discuss.elastic.co/t/creating-metric-visualization-with-sum-of-top10-hits/211139/4 "2020-02-09T21:05:53Z")

</div>

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