Dashboards & Visualizations

Form and inputlookup

DTERM
Contributor

What is the problem with the following form? The form utilizes inputlookup to generate a dropdown. The dropdown list works. However the query portion is not working out. Where is this problem? Thanks in advance.

    <form class="formsearch">
<label>Top H</label>
<!--
<searchTemplate>index=myapp supportGroup="$VGroup$" | top 15 tgtHostname</searchTemplate> 
<searchTemplate>index=myapp supportGroup="$VGroup$"</searchTemplate>
<searchTemplate>index=myapp supportGroup="$VGroup$" | top 15 "$VGroup$"</searchTemplate>
<searchTemplate>index=myapp supportGroup=$VGroup$ | top 15 $VGroup$</searchTemplate>
<searchTemplate>index=myapp supportGroup=$VGroup$ | top 15 supportGroup</searchTemplate>
-->

<searchTemplate>index= myapp supportGroup=$VGroup$</searchTemplate>

<fieldset>
   <input type="dropdown" token="supportGroup">
   <label>Select Support Group</label>
   <choice value="*">All</choice>
   <populatingSearch fieldForValue="VGroup" fieldForLabel="VGroup"><![CDATA[|inputlookup supportgroup.csv | fields + VGroup]]></popula
tingSearch>
  </input>

    <input type="time">
        <default>Last 7 days</default>
    </input>
</fieldset>

  <row>
    <chart>
      <title>Top Hosts</title>
      <option name="charting.chart">pie</option>
      <option name="drilldown">all</option>
    </chart>
    <chart>
      <title>Top Hosts</title>
      <option name="drilldown">all</option>
    </chart>
  </row>
  <row>
    <table>
      <title>Top Hosts</title>
      <option name="drilldown">all</option>
    </table>
  </row>


</form>
Tags (1)
0 Karma
1 Solution

lguinn2
Legend

I think it should be

<searchtemplate>index= myapp supportGroup="$supportGroup$"</searchtemplate>

I put quotes around variables as a best practice. They aren't required.

View solution in original post

0 Karma

lguinn2
Legend

I think it should be

<searchtemplate>index= myapp supportGroup="$supportGroup$"</searchtemplate>

I put quotes around variables as a best practice. They aren't required.

0 Karma

rroberts
Splunk Employee
Splunk Employee

Couple of things:

1. Element and Attributes are case sensitive should be fieldForValue and fieldForLabel and check the elements searchTemplate and populatingSearch.

2. Your token is VGroup in your searchTemplate. Should match your token attribute value in your input element ie token="VGroup"

3. fieldForValue and fieldForLabel should be "supportGroup"

0 Karma

DTERM
Contributor

Thanks. It finally worked.

0 Karma

DTERM
Contributor

Your suggestion works.

This is the condensed script. Any idea why this does not work? The drop down works, however the query is blank.

index=MyApp supportGroup=$VGroup$

All |inputlookup supportgroup.csv | fields + VGroup Last 7 days
0 Karma

lguinn2
Legend

What do you get if you type

index=myapp supportGroup=XXX

in the search box, where XXX is the name of a valid support group?

0 Karma

DTERM
Contributor

The search comes up empty. It did not work. Any other ideas?

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 ...