Top 10 interface protocols

Hi all,

I’m new to Grafana and to database query in general.

I’m struggling creating a graph that could show what I would like: top 10 protocols of a packet capture interface in ntopng. I know there was a grafana ntopng plugin but it’s has been removed in latest versions.

So now I’m trying to re-create what probably ntopng plugin was already doing but using influxdb data source.

The schema for the table is this:

The best that I was able to reach is this:

SELECT derivative(“bytes”, 1s) * 8 FROM “autogen”.“iface:ndpi” WHERE (“ifid” = ‘5’) AND $timeFilter GROUP BY “protocol”

With which I can obtain the full list of procols. I wasn’t able to get the top 10 though. If use this

SELECT TOP(“derivative”,10) FROM (SELECT derivative(“bytes”, 1s) * 8 FROM “autogen”.“iface:ndpi” WHERE (“ifid” = ‘5’) AND $timeFilter GROUP BY “protocol”)

I get only a single line / bar graph with iface:ndpi.top

Any suggestion?

Thanks in advance

1 Like