thanks, but 2 questions arise:
1: Whatever field i use for collapse (fe. host.name) i get :
"reason": "no mapping found for hostname in order to collapse on"
Which fields can i collapse on ?
fe: GET /cmndmetrics/_mapping/field/host.name returns :
{
"cmndmetrics" : {
"mappings" : {
"host.name" : {
"full_name" : "host.name",
"mapping" : {
"name" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
}
}
}
}
}
but:
GET cmndmetrics/_search
{
"size": 1,
"query": {
"match_all": {}
},
"collapse": {
"field": "host.name"
}
}
returns error with:
"reason": {
"type": "search_context_exception",
"reason": "unknown type for collapse field `host.name`, only keywords and numbers are accepted"
}
2: When i get above working in "Dev Tools", i get (long) Json struct.
How can i use this query output to show a listview of all hosts (one line per host) ?
I think i have to be somewhere else than "dev tools" for this ?