Count values of one field based on uniqueness with another field


(Benjamin Wohlwend) #1

Sorry if the title doesn't make much sense, I'll try to explain. I have an API service that logs the version of the client as well as the customer ID on every API request. Now I want to know which client versions are used the most, which can be done with a simple term aggregation on the client_version field.

The problem with this is that some customers use the service much more heavily than others, so the results can be quite skewed towards heavy users. What I'd like to do is count unique occurrences of client_version/customer_id, and sum them up per client_id. So basically count of customers for each client version. Does that make any sense? And is that possible with Kibana?


(CJ Cenizal) #2

Hi Benjamin... dang, I've spent 20 minutes trying to figure out if this is possible, and I still can't work it out. I'm looping in another engineer to see if this can be done.

Thanks,
CJ


(CJ Cenizal) #3

You mentioned client_version, customer_id, and client_id. I'm a little confused about the distinction of customer_id and client_id. Could you explain this some more? And could you share a couple example documents?

Thanks,
CJ


(CJ Cenizal) #4

I have an idea... how about you make a Data Table with a Bucket Terms Aggregation on the client_version field? And then you can make the Metrics Aggregation a Unique Count on the client_id field. Each row in the table will show you how many unique requests were made for each client_version. Does this help?

CJ


(system) #5