2

I have such a variable but it returns some values which I don't want to see(template0 and template1)

enter image description here

How can I filter them out ?

I tried to write label_values(datname!~"template.*|postgres")

But grafana says that this definition has broken syntax

gstackoverflow
  • 36,709
  • 117
  • 359
  • 710

2 Answers2

2

try to improve the query as follows

label_values({datname=~".+", datname!~"template.*|postgres"}, datname)

Hope this helps!

iamlucas
  • 131
  • 4
1

This works(filter both: postgres and tempate database): enter image description here

gstackoverflow
  • 36,709
  • 117
  • 359
  • 710