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!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

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