How to visualise objects fields in a tab like in DISPLAY 1 (see body message)

Hello,
I am using logstash to send data into elastic. My goal is to get a visualization in kibana like :
"DISPLAY 1"
group_num| name_group |unique count of id_document
10 |groupA |2
20 |groupB |3
10 |groupB |0
20 |groupA |0

AND NOT like "DISPLAY 2": (Now I get this visualization by putting in metric : unique count of id_document and group_num and group_name in bucket)
group_num| name_group |unique count of id_document
10 |groupA |2
20 |groupB |3
10 |groupB |2
20 |groupA |2

Here is the mappings of the index :

{
  "mappings": {
    "_doc": {
      "properties": {
		"id_document": {
			  "type": "text",
			  "fields": {
			    "keyword": {
			      "type": "keyword"
			    }
			  }
			},
		  "group": {
			  "properties": {
			    "group_num": {
			      "type": "long"
			    },
			    "name_group": {
			      "type": "text",
			      "fields": {
				"keyword": {
				  "type": "keyword"
				}
                             }
                           }
                          }
                  },
                  "...",
                  "..."[a lot of other fields]
      }
    }
   }
}

Here are the data:

{"id_document" : "doc1",
 "group" : [{
              "group_num" : 10,
              "name_group" : "groupA"
            },
            {
              "group_num" : 20,
              "name_group" : "groupB"
            }
          ],
 "...", 
 "...", [a lot of other fields]        
},
{"id_document" : "doc2",
 "group" : [{
              "group_num" : 10,
              "name_group" : "groupA"
            }
          ],
 "...",
 "...", [a lot of other fields]         
},
{"id_document" : "doc2",
 "group" : [{
              "group_num" : 10,
              "name_group" : "groupA"
            },
            {
              "group_num" : 20,
              "name_group" : "groupB"
            }
          ],
  "...",
  "...", [a lot of other fields]         
},
{"id_document" : "doc3",
 "group" : [
            {
              "group_num" : 20,
              "name_group" : "groupB"
            }
          ],
 "...",
 "...", [a lot of other fields]         
}

How to get the visualization "DISPLAY 1" in KIBANA?
Thanks for your answer.

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