# Metric aggregation and Count

**URL:** <https://discuss.elastic.co/t/metric-aggregation-and-count/140770>\
**Category:** Kibana\
**Created:** [July 19, 2018, 2:53pm UTC](https://discuss.elastic.co/t/metric-aggregation-and-count/140770 "2018-07-19T14:53:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![itd20071](https://avatars.discourse-cdn.com/v4/letter/i/7cd45c/32.png) [@itd20071](https://discuss.elastic.co/u/itd20071)\
**Post date:** [July 19, 2018, 2:53pm UTC](https://discuss.elastic.co/t/metric-aggregation-and-count/140770/1 "2018-07-19T14:53:56Z")

</div>

We want to use metric aggregation to count how often certain entries (IP addresses in this case) occur in our data set and we ran into two problems.

First, ascending ordering is deprecated. Is there any other way to do achieve the same?

Second, is there a way to use the Count variable in a filter, for example only showing the entries with a certain value of Count?

---

<div class="post-metadata">

**Author:** ![jbudz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jbudz/32/45922_2.png) [@jbudz](https://discuss.elastic.co/u/jbudz)\
**Post date:** [July 19, 2018, 8:26pm UTC](https://discuss.elastic.co/t/metric-aggregation-and-count/140770/2 "2018-07-19T20:26:44Z")

</div>

Can you share a more info about how the data is organized and what you have so far?

I believe you can continue using ascending count with the caveat that it may be inaccurate. Kibana added a deprecation warning as a result of [https://github.com/elastic/elasticsearch/issues/17614#issuecomment-303013380](https://github.com/elastic/elasticsearch/issues/17614#issuecomment-303013380), but the latest comments indicate it's being left in. There aren't really any alternatives that I know of.

I wasn't able to find a way to filter based on count. Maybe a range aggregation(with a range of 1) instead of a terms aggregation, although I'm not sure the results will be useful. The filter and search bar in Kibana will be applied before the aggregation takes place, so we would need to use a [pipeline agg](https://www.elastic.co/guide/en/elasticsearch/reference/6.3/search-aggregations-pipeline-bucket-selector-aggregation.html) but unfortunately Kibana doesn't support that one.

---

<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:** [August 16, 2018, 8:26pm UTC](https://discuss.elastic.co/t/metric-aggregation-and-count/140770/3 "2018-08-16T20:26:45Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
