# TOP N graphs/series in Grafana

**URL:** <https://community.influxdata.com/t/top-n-graphs-series-in-grafana/3836>\
**Category:** Dashboards\
**Tags:** influxdb, grafana\
**Created:** [January 31, 2018, 2:42pm UTC](https://community.influxdata.com/t/top-n-graphs-series-in-grafana/3836 "2018-01-31T14:42:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![aurimasplu](https://avatars.discourse-cdn.com/v4/letter/a/7bcc69/32.png) [@aurimasplu](https://community.influxdata.com/u/aurimasplu)\
**Post date:** [January 31, 2018, 2:42pm UTC](https://community.influxdata.com/t/top-n-graphs-series-in-grafana/3836/1 "2018-01-31T14:42:55Z")

</div>

Hi,  
I am trying out combination of newest releases of telegraf, influxdb and grafana.  
My goal is monitor thousands of network devices from which every device might have hundreds of interfaces.  
I what to create overview dashboard with graphs of for example top 10 most utilized interfaces per device.  
I have made graph with all interfaces per device with query:

SELECT derivative(“ifHCInOctets”, 1s) \*8 FROM “interface” WHERE (“agent\_host” = ‘[test-router.test.net](http://test-router.test.net)’) AND $timeFilter GROUP BY “ifDescr”

 ![image](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/1X/7528426e1e43a3d7a065dd34fb46d5e870c541fc.png)

I have tried SLIMIT but it randomly selects some interfaces. I can not find a way to limit output to TOP 10 series.  
For example Graphite has function highestAverage (10).

I saw this question asked in forums few times over the years but no solid answer was provided.  
Perhaps this is possible to do with a help of other influx products.

---

<div class="post-metadata">

**Author:** ![katy](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/katy/32/855_2.png) [@katy](https://community.influxdata.com/u/katy)\
**Post date:** [February 2, 2018, 12:21am UTC](https://community.influxdata.com/t/top-n-graphs-series-in-grafana/3836/2 "2018-02-02T00:21:51Z")

</div>

Kapacitor can be used to help with this.

I think the option that would be best is similar to this [Live Leaderboard](https://docs.influxdata.com/kapacitor/v1.4/guides/live_leaderboard/) example.

---

<div class="post-metadata">

**Author:** ![waxitoh](https://avatars.discourse-cdn.com/v4/letter/w/bc79bd/32.png) [@waxitoh](https://community.influxdata.com/u/waxitoh)\
**Post date:** [March 2, 2018, 10:50am UTC](https://community.influxdata.com/t/top-n-graphs-series-in-grafana/3836/3 "2018-03-02T10:50:18Z")

</div>

Hi,  
This is a very important question, for people not using (and not planning to use) Kapacitor.

Additionally, are there plans to introduce “order by anything else apart from time” eg. sum etc in the near future and therefore give a way to obtain “top n” series ?

Or is there a workaround to obtain the TOP N series ?  
regards,

---

<div class="post-metadata">

**Author:** ![Igor](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/igor/32/1058_2.png) [@Igor](https://community.influxdata.com/u/Igor)\
**Post date:** [March 2, 2018, 3:51pm UTC](https://community.influxdata.com/t/top-n-graphs-series-in-grafana/3836/4 "2018-03-02T15:51:22Z")

</div>

Support for TOP N was recently added to IFQL:  
[https://github.com/influxdata/ifql/pull/229](https://github.com/influxdata/ifql/pull/229)

I don’t know if there are any plans to add it to InfluxQL, as IFQL is supposed to replace it in the future.

---

<div class="post-metadata">

**Author:** ![waxitoh](https://avatars.discourse-cdn.com/v4/letter/w/bc79bd/32.png) [@waxitoh](https://community.influxdata.com/u/waxitoh)\
**Post date:** [March 5, 2018, 12:12pm UTC](https://community.influxdata.com/t/top-n-graphs-series-in-grafana/3836/5 "2018-03-05T12:12:18Z")

</div>

Thanks, i wasn’t aware of ifql – i hope it gets supported in grafana one day 🙂

---

<div class="post-metadata">

**Author:** ![frazer](https://avatars.discourse-cdn.com/v4/letter/f/4bbf92/32.png) [@frazer](https://community.influxdata.com/u/frazer)\
**Post date:** [July 11, 2018, 9:47am UTC](https://community.influxdata.com/t/top-n-graphs-series-in-grafana/3836/6 "2018-07-11T09:47:32Z")

</div>

Did you found a suitable solution for your request ?
