I have Grafana v 7.3.6 and i’m trying to extract some content from my data.I have created a variable called PQ.As datasource i am using Prometheus and the type of variable is Query.
My goal is to extract the value of label “label_chart”.For this purpose i am using the grafana pre-defined variable label_values.This will give me 3 results as shown below:
But instead of the whole string sdc-5.17.2-HF01 i want only first 4 characters after the first minus(-)
This means that i want to grep only 5.17.I tried serval regex patterns but without success.
Your regex will work, but if the input to the regex changes, it’s less safe and you may get unexpected results. But if you have control of the input, that should not be a problem.