Templating regex exclude not working

I was just tackling this issue today.

My dashboard template variable is for a customer list from InfluxDB data source. The initial query looks like:
SHOW TAG VALUES FROM "series_name" WITH KEY = "customer"

Of course, I don’t want to look at any of my internal, test, or demo accounts, so I needed to use the regex to exclude those. I’m using the negative lookahead as daniellee mentioned, but since this is in the templating section and not the metrics, it’s a little different. My regex line has:
/^(?!abc|.*demo|.*test)/

This is working for me at this time. I hope it helps you out.

3 Likes