Dashboards & Visualizations

passing variables within a form

DTERM
Contributor

I've trying to pass variables within a form. It does not appear to be working. The code below produces the dropdown. The dropdown works. I need to pass the variable from the dropdown to the rest of the form to produce the charts. Any idea why the variable is not passed or why the charts are not displayed?

Thanks.

<form class="formsearch">

index=MyApp host=host

All |inputlookup zhost.csv | fields + zhost Last 7 days



Top Hosts
index=myapp host=$zhost$ | top serviceName limit="10"
pie
all




Top Hosts
index=myapp host=$zhost$ | top productName limit="10"
bar
all

Tags (1)
0 Karma
1 Solution

cphair
Builder

Hi dterm,

  1. Capitalization matters in Splunk tags. Use populatingSearch, searchTemplate, fieldForValue, and fieldForLabel.
  2. I don't think you need the searchTemplate entry anyway; my search works without it.
  3. Pass $host$ instead of $zhost$ to your search.
  4. I changed the tag search to searchString in your chart section and got a chart to display for my sample data.

Let me know if this helps.

View solution in original post

cphair
Builder

Hi dterm,

  1. Capitalization matters in Splunk tags. Use populatingSearch, searchTemplate, fieldForValue, and fieldForLabel.
  2. I don't think you need the searchTemplate entry anyway; my search works without it.
  3. Pass $host$ instead of $zhost$ to your search.
  4. I changed the tag search to searchString in your chart section and got a chart to display for my sample data.

Let me know if this helps.

DTERM
Contributor

Worked great!! thanks so much!!

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...