I am using Grafana and Prometheus. How do we exclude N/A or None from the list of values of a variable? The data will be something like
N/A
ABC-100
XYZ-200
123ABC
None
456-DGZ
I need just need to display all values other than N/A
and None
i.e. display only
ABC-100
XYZ-200
123ABC
I looked at Regexp & Grafana: exclusions and string cut
I tried ^(?!N\/A).*
enter image description here
It did not work.
This situation can be approached from two directions:
Depending on situation, this might be implemented in a couple ways. In the simplest case, where you extract values of label
my_label
from metricmy_metric
, you can use queryDemo of similar query here.
As you mentioned yourself for this regex with negative lookaround should be used.
Expression
/^(?!None$|N\/A$).+/
will filter out valuesNone
andN/A
leaving all others as is.