Group By all but one tag

influxql
#1

Is there a way to group by all but one tag. You can group by a regex but It doesn’t look like go lang supports negative look ahead regexes. If it’s a field we can use the !~ operator to do a negative match, but I don’t see anyway to do that on a group by statement.

Basically I am looking to do something like

SELECT sum("m1") FROM "metric" WHERE time > now() - 24h GROUP BY time(10s), !~/bar/

So sum the metric and group by all the tags except for the bar tag

#2

@connr You would need to specify each tag you want to GROUP BY. You can either use the * splat operator in that position or tag names. There are no other options currently.

1 Like