Hello, we log all user requests to our site and I’m trying to figure out via the API how many unique users have performed a specific action over the past 60 seconds.
So once I have a query for the subset I need via search/universal/relative API, is there a way to get the API to then give me a count of how many unique userId values exist in that subset?
query = your query
range = range in seconds
field = field that should be used by the term aggregation
order = Order of results, sorted by which field and ascending/descending
size = how many terms to report
Thanks for the answer Philipp, I was unaware of the “terms” search, and in fact I’m getting a 403 Unauthorized when I try to run that query (which I’m guessing is why it wasn’t in my API browser). I’ll get w/ our admin and get that fixed.
This looks very close to what I need, I don’t suppose it’s possible to then count up the various userId terms and return just a single count?