How to create multiple input controls with a nested data from JSON in Kibana

Hey guys,

I'm trying to show my nested data in multiple input controls in Kibana. All of them depends on the next one. All of my data are placed in one node.

How I created my index:

PUT structure
{
    "settings": {
        "number_of_replicas": 1,
        "number_of_shards": 1
    },
    "mappings": {
        "doc": {
            "properties": {
                 "TreeStructure": { 
                     "type": "nested"
                  }
             }
        }
    }
}

I used json plugin from Logstash to insert my data from the database:

 filter {
   json { source => "TreeStructure" }
}

My index with "POST index/_search" looks like:

  { 
   ..... 
  },
  "hits": {
    "total": 1,
    "max_score": 1,
    "hits": [
      {
        "_index": "structure",
        "_type": "doc",
        "_id": "1111",
        "_score": 1,
        "_source": {
          "@timestamp": "2018-09-26T12:13:10.267Z",
          "TreeStructure":  [
              // Begin first Object
             {
                   "Groups": [
                    {
                        "Jobs": [
                            // Always different number of job objects
                            {
                               "JobName": "Job123",
                               "Number": 1
                            }                        
                        ],
                        "GroupName": "Group1"
                    },
                    {
                         "Jobs": [
                           {
                              "JobName": "Job145",
                              "Number": 1
                           },
                           {
                              "JobName": "Job267",
                              "Number": 2
                           }
                          ],
                          "GroupName": "Group2"
                      }
                    ],
                   "NameObject": "Object1"
                 },
        // End first object 
        // Begin second Object
        { 
          ..... // Many hunderds more
        }, ...
       ]
  }

So i created multiple input fields to visualize my data in Kibana.
After choosing the first "Object1" in my first input field I want to sort the next input field only after the available groups from "Object1". In this case it should only show Group1 and Group2 and not all Groups from the whole json index from "TreeStructure".

Here is a sample from my case:

 Choose ur Object                  After that, choose that your group
 ___________________________       ________________________________
|          Object1          |     |             Group1             |
 ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾       ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
                                  |             Group2             |
                                   ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
                                  |             Group10            |
                                   ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
                                  |             Group100           |
                                   ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
                                  |             Group54            |
                                   ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
                                  |             Group N            |
                                   ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾

But I only want:

 Choose ur Object                  After that, choose that your group
 ___________________________       ________________________________
|          Object1          |     |             Group1             |
 ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾       ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
                                  |             Group2             |
                                   ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾

The Elasticsearch sort doesn't work for this case.
How is this relizable with my case?

Thanks a lot for your help :slight_smile:

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