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]