Maximum per day over non_negative_derivative

Hi,
As the title, I have a metric where I get the bytes volume of a router’s interface, that I convert to rate with non_negative_derivative.

I need to get the maximum and minimum rate per day but I can’t figure out how to do it. I tried with nested queries, like this:

SELECT max 
  FROM (
       SELECT non_negative_derivative(mean("IF-MIB::ifHCInOctets.116.TASA"), 1s) 
         FROM "ne8k.hq.sslocal" 
        GROUP BY time(1h) fill(previous)
      ) WHERE $timeFilter 
GROUP BY time(24h) fill(0);

But I’m getting an error:

InfluxDB Error: GROUP BY requires at least one aggregate function

Removing the last group_by statement clears the error, but I got no results.

How can I solve this issue?

Many thanks in advance and sorry for poor english, Diego

Welcome @dmayan

Check this docu out

maybe this?

SELECT max(mayan)
  FROM (
       SELECT non_negative_derivative(mean("IF-MIB::ifHCInOctets.116.TASA"), 1s) as mayan
         FROM "ne8k.hq.sslocal" 
        GROUP BY time(1h) fill(previous)
      ) WHERE $timeFilter 
GROUP BY time(24h) fill(0);
1 Like

Thank you!! That did the trick. It works perfectly!

1 Like