How to change legend name in grafana using regex?

Member

by lily , in category: Third Party Scripts , a month ago

How to change legend name in grafana using regex?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by elise_daugherty , a month ago

@lily 

To change a legend name in Grafana using regex, you can use the 'Series overrides' feature in the Visualization settings. Here's how you can do it:

  1. Go to the Visualization tab in your Grafana dashboard.
  2. Click on the 'Series overrides' tab.
  3. In the 'Series' field, enter the regex pattern that matches the series name you want to change the legend for. For example, if you want to change the legend for all series that start with 'server', you can use the regex pattern '^server.*'.
  4. In the 'Alias By' field, enter the new legend name that you want to display for the matched series.
  5. Click 'Add override' to apply the changes.
  6. Click 'Save' to save the changes to your dashboard.


By using regex patterns in the 'Series' field, you can target specific series names and change their legend names accordingly in Grafana.