# How to create a dashboard for a key instead of a value

**URL:** <https://discuss.elastic.co/t/how-to-create-a-dashboard-for-a-key-instead-of-a-value/220425>\
**Category:** Kibana\
**Created:** [February 21, 2020, 5:12pm UTC](https://discuss.elastic.co/t/how-to-create-a-dashboard-for-a-key-instead-of-a-value/220425 "2020-02-21T17:12:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Goishin](https://avatars.discourse-cdn.com/v4/letter/g/46a35a/32.png) [@Goishin](https://discuss.elastic.co/u/Goishin)\
**Post date:** [February 21, 2020, 5:12pm UTC](https://discuss.elastic.co/t/how-to-create-a-dashboard-for-a-key-instead-of-a-value/220425/1 "2020-02-21T17:12:16Z")

</div>

I'm trying to create a dashboard for a key instead of a value in my index. I might have the wrong index. I'd appreciate advice on this.

My kibana instance takes in test pass data. We use TestNG and when I set up my index, I just described a testng-results.xml file. There's a tiny bit of extra metadata so you know what testpass we're talking about, but other than that it's really just the testng-results.xml file is my whole index. It looks like so:

```auto
                    "results": {
                    "passed": {
                        "type": "integer"
                    },
                    "failed": {
                        "type": "integer",
                    },
                    "skipped": {
                        "type": "integer"
                    },
                    "start_time": {
                        "type": "date"
                    },
                    "duration_ms": {
                        "type": "long"
                    },
                    "test_classes": {
                        "name": {
                            "type": "string"
                        },
                        "test_methods": {
                            "name": {
                                "type": "string"
                            },
                            "status": {
                                "type": "string"
                            },
                            "signature": {
                                "type": "string"
                            },
                            "duration_ms": {
                                "type": "long"
                            },
                            "started_at": {
                                "type": "date"
                            }
                        }
                    }

```

Now when the data comes in, what I end up with is an index with all of the test names as children of "test\_classes", but they're not values I can find at "test\_classes", they're actually keys. So, for example, when I reference a single test, I would reference it like so:  
doc['results.test\_classes.com.blah.sometestclass.foo.status'].value  
or:  
params['\_source']['results']['test\_classes']['com.blah.sometestclass.foo']['status'].value

What I'd like to do is be able to create generic visualizations and a dashboard, and everything on the dashboard is unique to a single test. I can see how to do that if I could use a mustache operator in the spot where "com.blah.sometestclass.foo" is. But the test names ended up as keys in my index. And I can't figure out how I would use my index to create a generic dashboard that would display info about any test. I can see how I would make a static one, I could go one test at a time. But how would I make a generic one?

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [February 24, 2020, 8:16pm UTC](https://discuss.elastic.co/t/how-to-create-a-dashboard-for-a-key-instead-of-a-value/220425/2 "2020-02-24T20:16:49Z")

</div>

Hi, you probably won't be able to do a lot with the raw data that you have, but it sounds like there are ways to pivot / transform the data into a new index that is more suitable for the analysis you need.

Take a look at the "Transforms" feature in Kibana: [https://www.elastic.co/guide/en/elasticsearch/reference/7.5/transforms.html](https://www.elastic.co/guide/en/elasticsearch/reference/7.5/transforms.html)

There's a great tutorial on this to help you get started with sample data: [https://www.elastic.co/guide/en/elasticsearch/reference/7.5/ecommerce-transforms.html](https://www.elastic.co/guide/en/elasticsearch/reference/7.5/ecommerce-transforms.html)

I think by transforming to an entity centric view of the tests in another index, it will be more clear how to make the kind of dashboards you need.

---

<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:** [March 23, 2020, 8:16pm UTC](https://discuss.elastic.co/t/how-to-create-a-dashboard-for-a-key-instead-of-a-value/220425/3 "2020-03-23T20:16:57Z")

</div>

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