Count unique combination of fields

Hi,

For some time I am searching now, but cannot find if what I need is possible. I have this index with several fields that are aggregatable. I want to fill a table with these fields, one row per unique combination of fields. The events in ElasticSearch als have a duration time in the same event, so for these events I als want to have columns giving me the lowest duration, highest duration and average duration of this specific combination.

So let’s say the events are as following:

request : url                     : device   : duration(ms)
GET     : /first/second/third     : android  : 20
GET     : /first/second/fourth    : android  : 20
GET     : /first/second/third     : android  : 31
GET     : /first/second/third     : android  : 33
GET     : /first/second/third     : ios      : 20
GET     : /first/second/fourth    : ios      : 30
GET     : /first/second/third     : ios      : 30
POST    : /first/second/third     : android  : 20
POST    : /first/second/fourth    : android  : 20
POST    : /first/second/third     : android  : 31
POST    : /first/second/third     : android  : 33
POST    : /first/second/third     : ios      : 20
POST    : /first/second/fourth    : ios      : 30
POST    : /first/second/third     : ios      : 30

Then I want a table back with:

Nr. of occurrances: Call                                    : min. dur. : avg. dur. : max. dur.
3                        : GET /first/second/third/android   : 20       : 28        : 33
1                        : GET /first/second/fourth/android  : 20       : 20        : 20
2                        : GET /first/second/third/ios       : 20       : 25        : 30
1                        : GET /first/second/fourth/ios      : 30       : 30        : 30
3                        : POST /first/second/third/android  : 20       : 28        : 33
1                        : POST /first/second/fourth/android : 20       : 20        : 20
2                        : POST /first/second/third/ios      : 20       : 25        : 30
1                        : POST /first/second/fourth/ios     : 30       : 30        : 30

Is this possible in Grafana?

Well it’s not supported to combine two fields into one column like url and device. For that you would need to index a field for that purpose.

The follwoing
Metric: count
Metric: avg(duration
Metric: max(duration
Metric: min(duration
Terms: device
Terms: url

Should give you a table like this:

url                      device   count   avg   max  min
GET /first/second/third  android  3       20    28   33

Hmmm… The funny thing is: I managed to do something like this on Kibana by now, but somehow I can’t get it to work in Grafana?