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!

CX Day is Coming!

Customer Experience (CX) Day is on October 7th!! We're so excited to bring back another day full of wonderful ...

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...