Dashboards & Visualizations

Is there a way to achieve complex-value dropdown?

blueocean
Loves-to-Learn

I have my data as follows:
| table envName, envAcronym, envCluster

I am using envName as Label of the dropdown but want to use envAcronym and envCluster as the value. From the dropdown editor, I dont see a way to specify multiple values. Is there a way to achieve what I am looking for?

I tried setting the value as a json object but then dereferencing the variables with dot notation does not work. For example I tried to reference value as "$selectedEnv.envAcronym$" and $selectedEnv.envCluster$ but it does not work.

Labels (2)
0 Karma

blueocean
Loves-to-Learn

Thank you @gcusello. One thing I am still not able to figure out is "where" do I run the rex command to extract the field. For example, one the dashboard panels needs the selected envCluster as follows:

| mstats avg(_value) as "Avg" where index IN(k8_metrics)  cluster_name=$envCluster$ AND metric_name="kube.node.memory.usage_bytes" span=1m by node

 

I cannot add a rex clause before mstats as that is not allowed. I understand that it would work fine for normal search based panels where I can add rex command easily. 

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @blueocean t,

I rarely use mstats, but probably runs:

| mstats avg(_value) as "Avg" where index IN(k8_metrics) AND metric_name="kube.node.memory.usage_bytes" span=1m by node
| rex field=$envCluster$ "^(?<envAcronym>[^\|]+)\|(?<envCluster>.*)"
| search cluster_name=envCluster

Ciao.

Giuseppe

0 Karma

gcusello
SplunkTrust
SplunkTrust

HI @blueocean ,

you could be to use in the dropdown:

| eval value=envAcronym."|".envCluster
| table envName value

using envName as label and value as value.

then in the search you can divide the value using a regex

| rex field=value "^(?<envAcronym>[^\|]+)\|(?<envCluster>.*)"

Ciao.

Giuseppe

0 Karma
Get Updates on the Splunk Community!

Index This | Why did the turkey cross the road?

November 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  &#x1f680; Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...