Interpolate variable to get first part of result of prometheus query

This is the prometheus query used in Variable. This returns me list of jobs. I would want display drop down whose job name starts with okcs and extract only first part of the job name before colon ( : ) (it’s weblogic domain name)

  1. Query - label_values(wls_server_activation_time,job) Current Regex: okcs.*
    Current output
    okcs_domain_pp455:cl1
    okcs_domain_pp455:cl2
    okcs_domain_pp455:cl3
    okcs_domain_pp456:cl1
    okcs_domain_pp456:cl2
    okcs_domain_pp456:cl2

Expected Output:
okcs_domain_pp455
okcs_domain_pp456

Further is it possible to display just pp5 and pp6 as text and okcs_domain_pp455 and okcs_domain_pp456 as value respectively in the dropdown?
I.e Display drop down as
pp5(value=okcs_domain_pp6)
pp6(value=okcs_domain_pp5)

I could not get the single regex meeting above conditions. Any help is deeply appreciated.

Hi @murthymymail

this is an interesting questions. Can you share what your data looks like in table view? Or share a screenshot from inspect => data? I’m wondering if you could use transformations to add another field to the series, and use regex there to get the values you want. That, or maybe add another label to the series, if you control the endpoint that you are scraping…