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!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...