Aggregation - Filter by Count


I'm just doing some aggregation queries on logdata I've collected with elasticsearch. What I would love to do is something like "get a distinct count of 'xxx' but only if distinct_count(xxx) is greater than 20" for instance. Getting distinct counts works perfect so far, just missing the rest somehow.
Is this even possible to only get results back where the distinct count is < or > a given value?

Did you try the new pipeline aggregations?

Sorry, dont have the solution in mind, but this should help, don't hesitate to post your solution here!