# "Rename by regex" is not working properly with "Labels to fields"

**URL:** <https://community.grafana.com/t/rename-by-regex-is-not-working-properly-with-labels-to-fields/126522>\
**Category:** Dashboards\
**Tags:** transformations, regex\
**Created:** [July 18, 2024, 11:18am UTC](https://community.grafana.com/t/rename-by-regex-is-not-working-properly-with-labels-to-fields/126522 "2024-07-18T11:18:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![huzifa1](https://avatars.discourse-cdn.com/v4/letter/h/f4b2a3/32.png) [@huzifa1](https://community.grafana.com/u/huzifa1)\
**Post date:** [July 18, 2024, 11:18am UTC](https://community.grafana.com/t/rename-by-regex-is-not-working-properly-with-labels-to-fields/126522/1 "2024-07-18T11:18:34Z")

</div>

- What Grafana version and what operating system are you using?  
I am using v9.5.5

- **What** are you trying to achieve?  
When applying Labels to fields transformation, the legend will be by default the combination of the labels that I have selected, I want to change this to only specific labels (only node and time in this case). You can see the default behavior in this image:  

**Note** : I know that not all legend have pipeline\_id, that is because I added this label recently, just focus on the 4th line where all labels exist.

- **How** are you trying to achieve it?  
Apply rename by regex transformation after the “Labels to fields” transformation

- What happened?  
When I add the "Rename by regex, it surprisingly set the legend to “Value” and matches to it as shown in the picture:  

- What did you **expect** to happen?  
I expected to match to the combination of labels that was previously

Some of you might suggest using value mappings, but I can’t use it in this case because right now I have a data link that reads the value of one of the labels (pipeline\_id in this case), and when I use value mappings to remove the pipeline\_id, it actually removes it also from the link. “Rename by regex” doesn’t have this effect, since I tried it in different graphs (where I did not use “Labels to fields” obviously)
