# How to filter range on cardinality aggregations ES v1.3.4 please?

**URL:** https://discuss.elastic.co/t/how-to-filter-range-on-cardinality-aggregations-es-v1-3-4-please/20343
**Category:** Elasticsearch
**Created:** [October 20, 2014, 2:27pm UTC](https://discuss.elastic.co/t/how-to-filter-range-on-cardinality-aggregations-es-v1-3-4-please/20343 "2014-10-20T14:27:54Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![rmkml](https://avatars.discourse-cdn.com/v4/letter/r/df705f/32.png) [@rmkml](https://discuss.elastic.co/u/rmkml)
#### Post date: [October 20, 2014, 2:27pm UTC](https://discuss.elastic.co/t/how-to-filter-range-on-cardinality-aggregations-es-v1-3-4-please/20343/1 "2014-10-20T14:27:54Z")

</div>

Hello,

First, thx you for very good ELK !

Anyone help me for how to filter range on cardinality aggregations please ?

ok please look my query working example:

curl -XGET '[http://localhost:9200/logstash-2014.10.20/\_search?search\_type=count&pretty=true](http://localhost:9200/logstash-2014.10.20/_search?search_type=count&pretty=true)' -d  
'{ "size":9999999, "aggs": { "distinct\_ip\_src": { "cardinality": { "field": "IP\_SRC"}}}}'  
response:  
{  
"took" : 34,  
"timed\_out" : false,  
"\_shards" : {  
"total" : 5,  
"successful" : 5,  
"failed" : 0  
},  
"hits" : {  
"total" : 12975,  
"max\_score" : 0.0,  
"hits" : []  
},  
"aggregations" : {  
"distinct\_ip\_src" : {  
"value" : 10  
}  
}  
}

But now, how to filter like a range distinct\_ip\_src.value (10 here) please ?

query not working: (no hits reply)  
curl -XGET '[http://localhost:9200/logstash-2014.10.20/\_search?search\_type=count&pretty=true](http://localhost:9200/logstash-2014.10.20/_search?search_type=count&pretty=true)' -d  
'{ "size":9999999, "aggs": { "distinct\_ip\_src": { "cardinality": { "field": "IP\_SRC"}}},"post\_filter",{"query": {"range":{"distinct\_ip\_src.value":{"gt":9}}}}}'  
Tryed only "value": not work  
Tryed only "\_value": not work  
Tryed only "term": not work  
size:0 : not better work  
Tryed removing "search\_type=count": not work

Best Regards  
@Rmkml

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/75edbbd1-7136-445d-889a-3f4d13d02e84%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/75edbbd1-7136-445d-889a-3f4d13d02e84%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 6, 2017, 12:55am UTC](https://discuss.elastic.co/t/how-to-filter-range-on-cardinality-aggregations-es-v1-3-4-please/20343/2 "2017-07-06T00:55:00Z")

</div>


