# Visualization of errors aggregated by exception name and stack trace

**URL:** https://discuss.elastic.co/t/visualization-of-errors-aggregated-by-exception-name-and-stack-trace/295709
**Category:** Kibana
**Created:** [January 28, 2022, 1:34pm UTC](https://discuss.elastic.co/t/visualization-of-errors-aggregated-by-exception-name-and-stack-trace/295709 "2022-01-28T13:34:55Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![xsw2-2wsx](https://avatars.discourse-cdn.com/v4/letter/x/ee59a6/32.png) [@xsw2-2wsx](https://discuss.elastic.co/u/xsw2-2wsx)
#### Post date: [January 28, 2022, 1:34pm UTC](https://discuss.elastic.co/t/visualization-of-errors-aggregated-by-exception-name-and-stack-trace/295709/1 "2022-01-28T13:34:55Z")

</div>

Hi,

I am looking for a Kibana visualization that displays the count of errors that took place in a time range, grouped by an exception and a stack trace.

the relevant mappings:

```auto
{
  "index_patterns": [...],
  "mappings": {
    "_source": {
      "enabled": true
    },
      "count": {
        "type": "double",
        "index": false
      },
      "stacktrace": {
        "type": "keyword",
        "index": true
      },
      "exception": {
        "type": "keyword",
        "index": true
      }
    }
  }
}

```

I've decided to use a Data Table visualization and configure it as follows:

- Metrics: sum of count
- Buckets:  
split rows: terms aggregation on field `exception`  
split rows: terms sub aggregation on field `stacktrace`

This basically accomplished what i wanted, with one exception: when the time range does not  
include any errors of particular type (particular exception + stack trace), it is also shown in a table with a `sum of count` aggregation equal to 0. Those irrelevant rows make it impractical to find the errors of interest.

Am I approaching this problem in a right way? Is there a better way to do this?  
If not, how could I show only the errors that actually occurred during the selected time range?

---

<div class="post-metadata">

### Author: ![Tomo\_M](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@Tomo\_M](https://discuss.elastic.co/u/Tomo_M)
#### Post date: [January 28, 2022, 5:24pm UTC](https://discuss.elastic.co/t/visualization-of-errors-aggregated-by-exception-name-and-stack-trace/295709/2 "2022-01-28T17:24:10Z")

</div>

A simple solution in your case seems to "Add filter" for `"count" is between 1 to some big value.`

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/2/128692d4c99ac4104aa38a1757160af9ba90db84.png)

---

<div class="post-metadata">

### Author: ![xsw2-2wsx](https://avatars.discourse-cdn.com/v4/letter/x/ee59a6/32.png) [@xsw2-2wsx](https://discuss.elastic.co/u/xsw2-2wsx)
#### Post date: [January 31, 2022, 5:59pm UTC](https://discuss.elastic.co/t/visualization-of-errors-aggregated-by-exception-name-and-stack-trace/295709/3 "2022-01-31T17:59:00Z")

</div>

Thank you, this works as expected!

---

<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 28, 2022, 5:59pm UTC](https://discuss.elastic.co/t/visualization-of-errors-aggregated-by-exception-name-and-stack-trace/295709/4 "2022-02-28T17:59:11Z")

</div>

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