Select "Top" Series


New to influxdata / influxDB, but really liking it. Getting my data stored just fine, but now let me try to explain my issue getting it back out … .:grinning:

I am storing traffic data, for a subnet - traffic each second (sent and received), for each machine … so 255 points (subnet) of sent and received each second. That all works great. Now, I want to extract (plot) it, and want to grab only the top N (say, 3) users over a timespan. My issue is - how do I select only those top N users … say the ones with the highest sum or maximum value over the period. Any thoughts? Has someone else figured this out already?


@arrmo You can use the TOP() and BOTTOM() functions now to help figure out questions like this. If you want to rank by max, min, mean, etc… then you would use a continuous query to precompute the aggregate and then TOP and BOTTOM to filter the results. We also reciently merged a PR that improves the performance and extends the syntax for TOP and BOTTOM that will be included in the ```1.3` release later this month.

Will dig into this more, the continuous query may be the key part here.