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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Index This | What travels the world but is also stuck in place?

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

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...