-1

I am using grafana variables to bring some data, but the data comes with '%20' that I need to remove using regex, I have tried many times without result, the data has this form:

PSM%20APP%20ST%20
PSM%20AV
PSM%20High%20Ase
PSM%20Ate

I want to remove all appearances of %20, it should look like this:

PSM APP ST
PSM AV
PSM Alta Ase
PSM Ate

Please, who can help me solve? Thank you.

9
  • 1
    What's the problem? s/%20/ /g? Commented Jul 10, 2024 at 17:51
  • This is URL encoding. Most languages have a function for decoding, e.g. urldecode() in PHP. Commented Jul 10, 2024 at 17:52
  • I tried it, it doesn't work in grafana variables Commented Jul 10, 2024 at 17:52
  • 2
    Edit the question to add a minimal reproducible example showing the code. Commented Jul 10, 2024 at 17:58
  • 1
    You've said "grafana variables" multiple times, there's no need to repeat it. I don't actually know grafana, I don't know why it would make a difference. Commented Jul 10, 2024 at 17:59

1 Answer 1

2

Grafana's regex functionality for variables only works for filtering and extraction.

Other manipulations, like replacement, are not supported.

Since here all desired data cannot be extracted into a single group, regex is not something what can solve your problem. You need to modify your data on the data source level, or use chained variables to create new variable based on the existing one.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.