Custom aggregation and script inside of Kibana


(Beau) #1

Hi all,

I'm working on an aggregation for an API management tool and we'd like to see how many requests per user each app using our API tool uses. I've written the code already as an ElasticSearch query but I can't figure out how to translate it into something that would be a Kibana visualization. Any ideas?

[code]{
"size":0,
"aggregations": {
"apps": {
"terms": {
"field": "application_name"
},
"aggregations" : {
"user_count" : {
"cardinality" : {
"field" : "user_id"
}
},
"total_request" : {
"value_count" : {
"field" : "created_at"
}
} ,
"avg_request_per_app" : {
"bucket_script": {
"buckets_path": {
"totalUsers": "user_count",
"totalRequest": "total_request"
},
"script": "totalRequest / totalUsers"
}
}

    } 
  }

}

}[/code]


(Shaunak Kashyap) #2

Unfortunately pipeline aggregations are not yet supported in Kibana. There is an issue open for it, though, if you want to follow its progress: https://github.com/elastic/kibana/issues/4584.


(Beau) #3

Thanks for the reply! I'll keep an eye on the issue and in the meanwhile, let me know if I can help at all.


(system) #4