Aggregation - Filter by Count

Hi

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?

https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-bucket-selector-aggregation.html

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

Thanks,