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>
I think it should be
<searchtemplate>index= myapp supportGroup="$supportGroup$"</searchtemplate>
I put quotes around variables as a best practice. They aren't required.
I think it should be
<searchtemplate>index= myapp supportGroup="$supportGroup$"</searchtemplate>
I put quotes around variables as a best practice. They aren't required.
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"
Thanks. It finally worked.
Your suggestion works.
This is the condensed script. Any idea why this does not work? The drop down works, however the query is blank.
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?
The search comes up empty. It did not work. Any other ideas?