Use a regex group name in an Override datalink for the Stat plugin

  • What is your Grafana version? 8.1.8
  • Are you using Grafana Cloud or self-hosted Grafana? Self-hosted
  • Are you using legacy alerting or Unified Alerting? Not used for alerting
  • was the alert in question migrated from the legacy platform into Unified Alerting, or did you first create it inside the new platform? N/A
  • What are you trying to achieve?

I’m trying to use a datalink from the override section within Stat plugin

  • How are you trying to achieve it?
  • I add an override and use: “Fields with name matching regex”
  • Then I add a regex to get a named group: (?<A_POD>[a-z]{1,3}[0-9]{1,3}).*
  • Now I add a data-link, for example:${A_POD}
  • What happened? The data-link doesn’t work well. It displays ${A_POD} and not the result of the named group from the regex.

  • What did you expect to happen? I need to display the group name from the regex.

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

Thank you!!!

I wouldn’t rely on value-mapping to be fully interoperable with data-links or template variables. Especially for regex-based value mapping. It’s a relatively new feature and doesn’t always play well with these other features

Thank you. It does work actually on polystat, but not with the Stat Plugin.

1 Like