<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Calling multiple Search Templates in a form in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calling-multiple-Search-Templates-in-a-form/m-p/46840#M2301</link>
    <description>&lt;P&gt;Is it the same to separate searches in every chart?&lt;/P&gt;</description>
    <pubDate>Thu, 20 Mar 2014 09:29:16 GMT</pubDate>
    <dc:creator>0range</dc:creator>
    <dc:date>2014-03-20T09:29:16Z</dc:date>
    <item>
      <title>Calling multiple Search Templates in a form</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calling-multiple-Search-Templates-in-a-form/m-p/46837#M2298</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;I am trying to call to 2 search template in the same form and then display them with different charts.&lt;BR /&gt;
 However, I found the charts in lower part can't show anything unless if remove the first search Template the corresponding charts.&lt;BR /&gt;
Is this possible to do?&lt;/P&gt;

&lt;P&gt;Please suggest.&lt;/P&gt;

&lt;P&gt;Thanks!!&lt;/P&gt;

&lt;P&gt;This is the code:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;Simple select drop down&amp;lt;/label&amp;gt;
  &amp;lt;!-- define master search template, with replacement tokens delimited with $ --&amp;gt;
  &amp;lt;searchName&amp;gt;abc&amp;lt;/searchName&amp;gt;
  &amp;lt;searchTemplate&amp;gt;sourcetype="search1"&amp;lt;/searchTemplate&amp;gt;
  &amp;lt;earliestTime&amp;gt;-300d&amp;lt;/earliestTime&amp;gt;
  &amp;lt;latestTime&amp;gt;-0d&amp;lt;/latestTime&amp;gt;
  &amp;lt;searchTemplate&amp;gt;"search2"&amp;lt;/searchTemplate&amp;gt;
  &amp;lt;earliestTime&amp;gt;-300d&amp;lt;/earliestTime&amp;gt;
  &amp;lt;latestTime&amp;gt;-0d&amp;lt;/latestTime&amp;gt;
  &amp;lt;fieldset&amp;gt;
    &amp;lt;!-- Define a simple dropdown form driven by a search --&amp;gt;
    &amp;lt;input type="dropdown" token="UserName"&amp;gt;
      &amp;lt;label&amp;gt;Select user&amp;lt;/label&amp;gt;
      &amp;lt;populatingSearch fieldForValue="UserName" fieldForLabel="UserName"&amp;gt;&amp;lt;![CDATA[|savedsearch Details|top UserName]]&amp;gt;&amp;lt;/populatingSearch&amp;gt;
      &amp;lt;choice value="%"&amp;gt;All&amp;lt;/choice&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;chart&amp;gt;
      &amp;lt;title&amp;gt;TimeChart&amp;lt;/title&amp;gt;
      &amp;lt;option name="charting.chart"&amp;gt;pie&amp;lt;/option&amp;gt;
    &amp;lt;/chart&amp;gt;
    &amp;lt;chart&amp;gt;
      &amp;lt;title&amp;gt;TimeChart&amp;lt;/title&amp;gt;
      &amp;lt;option name="charting.chart"&amp;gt;bar&amp;lt;/option&amp;gt;
    &amp;lt;/chart&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Nov 2012 04:55:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calling-multiple-Search-Templates-in-a-form/m-p/46837#M2298</guid>
      <dc:creator>alenseb</dc:creator>
      <dc:date>2012-11-28T04:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: Calling multiple Search Templates in a form</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calling-multiple-Search-Templates-in-a-form/m-p/46838#M2299</link>
      <description>&lt;P&gt;Move the searches inside the charts.&lt;/P&gt;

&lt;P&gt;i.e.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;chart&amp;gt;
  &amp;lt;searchTemplate&amp;gt;sourcetype="search1"&amp;lt;/searchTemplate&amp;gt;
  &amp;lt;earliestTime&amp;gt;-300d&amp;lt;/earliestTime&amp;gt;
  &amp;lt;latestTime&amp;gt;-0d&amp;lt;/latestTime&amp;gt;
  &amp;lt;title&amp;gt;TimeChart&amp;lt;/title&amp;gt;
  &amp;lt;option name="charting.chart"&amp;gt;pie&amp;lt;/option&amp;gt;
&amp;lt;/chart&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you have 2 search templates at the same level, one will clobber the other.&lt;/P&gt;

&lt;P&gt;If you view the advanced xml  (add ?showsource=t to the end of your views URL) you'll see what the simple XML gets converted to.&lt;/P&gt;

&lt;P&gt;Whole sections of your forms xml mysteriously disappear.&lt;/P&gt;

&lt;P&gt;Here's a working example :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;Dashboard to convert to Form Search&amp;lt;/label&amp;gt;
  &amp;lt;fieldset&amp;gt;
    &amp;lt;input type="text" token="series"&amp;gt;
      &amp;lt;label&amp;gt;sourcetype&amp;lt;/label&amp;gt;
      &amp;lt;default/&amp;gt;
      &amp;lt;seed&amp;gt;splunkd&amp;lt;/seed&amp;gt;
      &amp;lt;suffix&amp;gt;*&amp;lt;/suffix&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;chart&amp;gt;
      &amp;lt;searchTemplate&amp;gt;index=_internal source=*metrics.log group="per_sourcetype_thruput" series=$series$ | timechart avg(eps) &amp;lt;/searchTemplate&amp;gt;
      &amp;lt;earliestTime&amp;gt;-1w&amp;lt;/earliestTime&amp;gt;
      &amp;lt;latestTime&amp;gt;-1d&amp;lt;/latestTime&amp;gt;
      &amp;lt;option name="charting.chart"&amp;gt;line&amp;lt;/option&amp;gt;
    &amp;lt;/chart&amp;gt;
    &amp;lt;chart&amp;gt;
      &amp;lt;searchTemplate&amp;gt;index=_internal source=*metrics.log group="per_sourcetype_thruput" series=$series$ | timechart avg(kbps) &amp;lt;/searchTemplate&amp;gt;
      &amp;lt;earliestTime&amp;gt;-1d&amp;lt;/earliestTime&amp;gt;
      &amp;lt;latestTime&amp;gt;now&amp;lt;/latestTime&amp;gt;
      &amp;lt;option name="charting.chart"&amp;gt;column&amp;lt;/option&amp;gt;
    &amp;lt;/chart&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Nov 2012 11:32:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calling-multiple-Search-Templates-in-a-form/m-p/46838#M2299</guid>
      <dc:creator>jonuwz</dc:creator>
      <dc:date>2012-11-28T11:32:51Z</dc:date>
    </item>
    <item>
      <title>Re: Calling multiple Search Templates in a form</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calling-multiple-Search-Templates-in-a-form/m-p/46839#M2300</link>
      <description>&lt;P&gt;Thanks!&lt;BR /&gt;
That worked! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Nov 2012 05:57:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calling-multiple-Search-Templates-in-a-form/m-p/46839#M2300</guid>
      <dc:creator>alenseb</dc:creator>
      <dc:date>2012-11-29T05:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: Calling multiple Search Templates in a form</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calling-multiple-Search-Templates-in-a-form/m-p/46840#M2301</link>
      <description>&lt;P&gt;Is it the same to separate searches in every chart?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Mar 2014 09:29:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calling-multiple-Search-Templates-in-a-form/m-p/46840#M2301</guid>
      <dc:creator>0range</dc:creator>
      <dc:date>2014-03-20T09:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: Calling multiple Search Templates in a form</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calling-multiple-Search-Templates-in-a-form/m-p/46841#M2302</link>
      <description>&lt;P&gt;How do the separate searchtemplate work in this example? Is there any performance profit? I do not understand&lt;/P&gt;</description>
      <pubDate>Thu, 27 Mar 2014 09:18:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calling-multiple-Search-Templates-in-a-form/m-p/46841#M2302</guid>
      <dc:creator>0range</dc:creator>
      <dc:date>2014-03-27T09:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: Calling multiple Search Templates in a form</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calling-multiple-Search-Templates-in-a-form/m-p/46842#M2303</link>
      <description>&lt;P&gt;thanks @jonuwz this helps with my problem as well.  &lt;/P&gt;

&lt;P&gt;What if you want to use one search for several rows and another search for a few more rows.&lt;/P&gt;

&lt;P&gt;Using your example at what level above the row would you put the template and still allow to run separately and only once each time the dashboard is refreshed?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2015 12:44:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calling-multiple-Search-Templates-in-a-form/m-p/46842#M2303</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2015-10-27T12:44:35Z</dc:date>
    </item>
  </channel>
</rss>

