Merging data from different jobs with slightly varying instance names

Hi, is there anyone good at merging data in a table? I have these 3 instances that use 2 different jobs, so the data appears on 6 lines instead of 3. I’ve been trying to join by instance, but the instance names are slightly different as 1 job is from blackbox and the other from pushgateway.

I did try and use the label_replace option to give them a column with the same name I could try and use to join or merge, but no luck either.

For example on my blackbox query it was something like this:

probe_http_status_code{job="blackbox-as", instance=~"http://(abc.*)-<http://domain.com/health|domain.com/health>"

and I added the label_replace

    probe_http_status_code{job="blackbox-as", instance=~"http://(abc.*)-<http://domain.com/health%22}|domain.com/health"}>,
    "type", "test", "instance", ".*"
)```


If I use the transformation merge series/tables then I see just the 3 instance over 6 lines instead of 3. If I join by label I get no options, I was expecting 'test'.  I did also try a join by field and used OUTER (TIME SERIES) and chose type, but no luck, as it seems to create a type 1 (pushgateway) and type 2 (blackbox).

Is there any way I can join this data?

it might worth checking out sql expression

I’ll give that a try, I didn’t know you could use another query/language with current queries from other datasources like this.

it’s a new amazing feature

see this on how to set things up
https://grafana.com/docs/grafana/latest/panels-visualizations/query-transform-data/sql-expressions/

Thanks, I’ll enable this feature and see if I can use your query example to join/merge this data.

Would A.Id and B.Id in my example of the column name? So A.type and B.Type for example?

the docu should help you sort that out.