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

**URL:** <https://discuss.elastic.co/t/how-to-create-multiple-input-controls-with-a-nested-data-from-json-in-kibana/150120>\
**Category:** Elasticsearch\
**Created:** [September 27, 2018, 5:44am UTC](https://discuss.elastic.co/t/how-to-create-multiple-input-controls-with-a-nested-data-from-json-in-kibana/150120 "2018-09-27T05:44:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nico92](https://avatars.discourse-cdn.com/v4/letter/n/a87d85/32.png) [@Nico92](https://discuss.elastic.co/u/Nico92)\
**Post date:** [September 27, 2018, 5:44am UTC](https://discuss.elastic.co/t/how-to-create-multiple-input-controls-with-a-nested-data-from-json-in-kibana/150120/1 "2018-09-27T05:44:21Z")

</div>

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 🙂

---

<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:** [October 25, 2018, 5:44am UTC](https://discuss.elastic.co/t/how-to-create-multiple-input-controls-with-a-nested-data-from-json-in-kibana/150120/2 "2018-10-25T05:44:45Z")

</div>

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