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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...