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

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:

                    "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?

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

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

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.

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