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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...