Changing Display names using a lookup table

  • What Grafana version and what operating system are you using?
    Grafana v10.3.3 (252761264e)

  • What are you trying to achieve?
    I am trying to rename legend entries en masse from a lookup table to avoid having to manually add overrides for hundreds of fields in 10+ panels.

Currently, I am doing this using manual overrides as in the below screenshot.

If I have a list of the field names and the labels that I want in a table, is there a way to do this with a script to avoid having to do it manually for each field?

@williammarkiewicz


import "strings"

sampledata.string()
    |> map(fn: (r) => ({r with _value: strings.replaceAll(v: r._value, t: "p", u: "XX")}))

1 Like

Thank you both very much for this, this works well! :slight_smile:

2 Likes