Kibana bar chart help


(Anna) #1

I'm using Kibana 4.1.2. I want to create a bar chart with the below details:
Manager name on x-axis and teams under him with unit test coverage.
I'm a new bie and facing trouble in creating bar chart.

I have the below filter
a filter in past 1 week sonarCreatedOn: [now-7d TO now]

Sample data:

{
  "took": 8,
  "timed_out": false,
  "_shards": {
    "total": 5,
    "successful": 5,
    "failed": 0
  },
  "hits": {
    "total": 4,
    "max_score": 1,
    "hits": [
      {
        "_index": "test-v1.0",
        "_type": "sonar",
        "_id": "AVJSMKQBpSv9QsmAakgk",
        "_score": 1,
        "_source": {
          "sonarCreatedOn": "2016-01-15T04:19:59.000-0700",
          "teamName": "Team 1",
          "managerName": "Manager 1",
          "directorName": "Director 1",
          "testCoverage": 49.5
        }
      },
      {
        "_index": "test-v1.0",
        "_type": "sonar",
        "_id": "BVJSMKQBpSv9QsmAakgk",
        "_score": 1,
        "_source": {
          "sonarCreatedOn": "2016-01-15T04:19:59.000-0700",
          "teamName": "Team 2",
          "managerName": "Manager 1",
          "directorName": "Director 1",
          "testCoverage": 10
        }
      },
      {
        "_index": "test-v1.0",
        "_type": "sonar",
        "_id": "BVJSMKQBpSv9QsmAakgk",
        "_score": 1,
        "_source": {
          "sonarCreatedOn": "2016-01-13T04:19:59.000-0700",
          "teamName": "Team 3",
          "managerName": "Manager 2",
          "directorName": "Director 1",
          "testCoverage": 70.4
        }
      },
      {
        "_index": "test-v1.0",
        "_type": "sonar",
        "_id": "BVJSMKQBpSv9QsmAakgk",
        "_score": 1,
        "_source": {
          "sonarCreatedOn": "2016-01-12T04:19:59.000-0700",
          "teamName": "Team 4",
          "managerName": "Manager 3",
          "directorName": "Director 2",
          "testCoverage": 0.2
        }
      }
    ]
  }
}

(Mark Walkom) #2

So you want managerName on X and teamName on Y, with a bar value for testCoverage?


(Anna) #3

Yes, and I wanted an consolidated manager name, for example Manger 1 on x-axis and two bars against that name, that is team 1 and team 2


(Mark Walkom) #4

This isn't exactly as I said before but it should work.

Create a bar chart and then change the default count value for Y axis to max for the testCoverage, then on the X axis split the charts based onmanagerName and finally use a terms sub-agg on teamName.


(Anna) #5

Thank you warkolm, that worked for me, is there a way that I can combine the manager names?
Not all teams have coverage every week unless they do a release.>


(Anna) #6

Oh I got it this time. My bad. Thanks a lot.


(Mark Walkom) #7

How did you do it?


(Anna) #8

When I used the sub-agg on teamName, earlier I used Split chart, changed to Split bars. Worked for me.
Attaching a screenshot. Can't show the manager and team names, sorry!

The only issue is that it doesn't show the teams which has 0 coverage.


(Mark Walkom) #9

Argh, that was my fault, I meant split bar not split chart!


(system) #10