How to Rename by ReGex a field value after applying Labels to fields?

Hello there!

  • What Grafana version and what operating system are you using?
    I am running Grafana 9.3.6.

  • What are you trying to achieve?
    I want to rename the values of one of the columns of my rows using a RegEx expression.
    But I also applied the transform “Labels to fields”.

  • How are you trying to achieve it?
    I tried using Rename by regex transformation but instead of renaming the values it renames the table header.

I also tried using Field override called Fields with name matching regex like this:
Fields with name matching regex: /./
Value mapping: ^Status do Serviço\s.(.
) ABC

image

  • What happened?
    It did not work.

  • What did you expect to happen?
    Rename my service names in the rows, it’s the values from the first column.

  • Can you copy/paste the configuration(s) that you are having problems with?
    I am currently trying:

Rename by regex after applying Labels to fields.
Override using Fields and value mappings using RegEx.

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
    No errors received on the UI or related logs.

  • Did you follow any online instructions? If so, what is the URL?
    Yes. I followed the same forums and instructions:

https://community.grafana.com/t/variable-with-value-mappings/24543/10

https://community.grafana.com/t/need-help-with-override-field-name-with-regex/73843
https://community.grafana.com/t/overrides-value-mappings-regex-not-working/55199

@horselessname using value mappings as mentioned in How to Rename Values in Grafana Using Regex-Based Value Mapping is the way to do this.

The transform will change the field name, but not the values. I see you tried using an override with a value mapping. To rename a value you want to select the field name Service Name in the drop-down for Fields with name. Then, add the value mapping override for the field values that you want to rename.

I literally googled Grafana RegEx Replace and just got to my own question. I did not remember that I went through this already and you gave me a solution previously hahah.

Thank you, It worked.

Hi, how can I remove a variable from urls in a panel and group the urls after the removal?

I figured after trying hard that the transform affects column names not values, and found on a link that mapping is the way to go, but mapping only changes the text and the result isn’t grouped by the transform after that, I have a panel showing urls hit by k6 and I have thousands of urls that are basically the same url but the user id is different and it’s in the get url. help please.