Using regular expressions to filter output of queries for further transforms

I am not sure if this is something that is already answered here, anyways… I would like to know how to use regular expressions or other mechanisms to filter output of queries for doing further transforms such as selecting the right query output for a specific panel.

Our instances run on Kubernetes which sends metrics to Grafana Cloud. As shown in the screenshot attached, one panel is one instance and 5 queries produce 5 outputs each for the 4 instances we have.

The issue here is every time our instance restarts, the IP address and pod names in the returned query output changes resulting in no data being displayed on the panels. So after every restart, we have to again select (select here as in tick as shown) new outputs from the same query and update all our panels which is a hassle!

Is there anyway we could create a regular expression to fix this problem? Here in the query output below we need a way to select the instance using the “service” or “job” name since the “instance” and “pod” names change during instance restart, is that possible?

One of the Query outputs for one of the instance “QPTI01”: ibmmq_qmgr_uptime{endpoint="metrics",instance="",job="mq-metric-service-qpti01",namespace="mq",platform="UNIX",pod="mq-metric-qpti01-64fbb77ccd-css4t",qmgr="QPTI01",service="mq-metric-service-qpti01"}


Anything in this thread here that might help?

Nope, this thread was opened by me sometime ago and the resolution was to set overrides. The current issue is different,

:joy: I didnt even see it was you. sorry.