Status History: Is it possible to use only part of the field name in a Data Link?

Hi everyone,

I’m trying to build a Status History panel where each column represents a firewall.

To generate the panel I’m pivoting the data in SQL, so the resulting field names are built by concatenating the customer name and the hostname, for example:

Foo BAR

The panel looks like this: (Blurred for sensitive data)

My goal is to make each column clickable and open another dashboard using a Data Link such as:

/d/firewall_overview/firewall-overview?var-customer=[customer name(foo)]&var-hostname=[hostname (bar)]

The problem is that, inside the Status History panel, the only value I seem to have available is the field name, which in my case is:

Foo Bar

What I need is to split it into:

Customer = Foo
Hostname = Bar

so that I can populate the URL like this:

var-customer=Foo
var-hostname=Bar

I’ve looked through the available Data Link variables, but I couldn’t find any way to split or parse the field name.

Questions

  1. Is there any built-in function in Grafana Data Links to split the field name (e.g. by space or another delimiter)?

  2. Is there another way to expose multiple metadata values (customer and hostname) for each Status History field?

  3. Would a field configuration, transformation, or another panel type make this possible without changing the visual result?

For reference, the field names are generated by a SQL pivot, so I currently have one field per firewall.

Any suggestions or best practices would be appreciated.

Thanks!

Skip splitting the field name → carry customer/hostname as field labels instead, then reference them in the Data Link via ${__field.labels.customer}.

Steps:

  1. Change SQL to long format (no pivot) →
sql

SELECT time, customer, hostname, status
FROM firewall_status
  1. Convert field type: time → Time
  2. Partition by values: fields = customer, hostname, Naming = “As label” → splits into one series per firewall, each carrying customer/hostname as labels.
  3. Join by field: on time, Outer mode → merges back into one wide table (same layout as your original pivot), each field keeps its labels.

5 . Field override → Fields with name matching regex = /status/ → Standard options → Display name:

${__field.labels.customer} ${__field.labels.hostname}

(restores your original “Foo Bar” column headers)

  1. Set panel type to Status History.
  2. Data Link:
/d/<u-id>/firewall-overview?var-customer=${__field.labels.customer}&var-hostname=${__field.labels.hostname}

  1. Is there any built-in function in Grafana Data Links to split the field name (e.g. by space or another delimiter)?
    No split function in Data Links → labels are the native mechanism for this.

  2. Is there another way to expose multiple metadata values (customer and hostname) for each Status History field?
    Yes, via field labels (step 3 above).

  3. Would a field configuration, transformation, or another panel type make this possible without changing the visual result?
    Yes, transformations only → same visual result, no SQL pivot needed.

don’t use “Rows to fields” → it collapses the time series into a single row, breaking Status History. Partition by values + Join by field is the correct pair.

Hi! Thank you so much for your help your suggestion worked perfectly and solved the problem.

I have one more question, if you don’t mind. Is there any way to have the devices that are currently offline appear at the top of the Status History panel? Ideally I’d like the offline devices to always be listed first, while keeping the rest of the panel unchanged.

Thanks again for your help!

Quick update: I managed to get the offline devices to appear at the top by ordering the query using last_seen.