Search code examples
variablesprometheusgrafanapromql

promQL to grafana panel union on similar labels


this is my promql to a variable in grafana graṕh

label_values({ index=~"xxx.*"},Operator) 

result:

abc test
abc ultra
def test
def super 

but i'd like to make the union of abc labels as abc and def labels as def

abc
def

does anybody knows how can I do this?


Solution

  • Use the following:

    Regex = /^([^ ]+) /