Modifying Series Display Name

Hello - I am using Grafana 8.3.4 with a Graphite data source. Both Grafana and Graphite reside on CentoOS 8. I have the following panel:

I am trying to change the display name to use just the text that follows the period. In the first series I want to display only VRF_Training and the second series should be Home, etc. I believe the proper way to do this is to create a dashboard variable that extracts the field of interest and then update the panel Standard options called Display name.

When I change the Display name to $pages my thinking is that I should see the the last part of the query results. However, instead what i am seeing is

Can someone tell me what I am going wrong and how to accomplish my goal?

Thank you.

Unless I have misunderstood your needs, I think setting up variables is not necessary. Have you tried using an Override as shown in the mockup below?

1 Like

Hello. No you did not understand. I have reviewed the Override feature and it appears exactly what I need. Thank you. I have follow up question. Since I have MANY panels with different page names, I will need to use a Match with RegEx. I cannot seem to find the right way to reference the RegEx capture group. Do you know where that is documented?

Hello again. As it turns out the solution to my issue is to use a Transformation, specifically using Rename by RegEx.

Hi, I got a similar requirement as your case, can you please show how to use those “transformation”?

I needed to do the same thing and this is how I did it:
Edit Query
Click ‘Transform’ tab (search in browser if you don’t see it)
Click ‘Add transformation’
Choose ‘Rename by regex’

I had a string like this: host:traffic.non_negative_derivative {host: 10.0.2.57}
and wanted just the IP address, so here is the regex I used for the Match: .*host\:\s(.*)\}$

2 Likes