<?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: searchTemplate and searchPostProcess in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/searchTemplate-and-searchPostProcess/m-p/190597#M11872</link>
    <description>&lt;P&gt;Hi somesoni2, you are right about tokens not being supported. As you know the base search is grabbing all users. I wanted a drop-down to specify a user... I guess I could create individual panels for users and just have the top 5 results for each user. It would look messy though.&lt;/P&gt;

&lt;P&gt;Thanks for responding btw.&lt;/P&gt;</description>
    <pubDate>Fri, 06 Jun 2014 15:57:51 GMT</pubDate>
    <dc:creator>ben_leung</dc:creator>
    <dc:date>2014-06-06T15:57:51Z</dc:date>
    <item>
      <title>searchTemplate and searchPostProcess</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/searchTemplate-and-searchPostProcess/m-p/190592#M11867</link>
      <description>&lt;P&gt;Splunk version 5.0.3&lt;/P&gt;

&lt;P&gt;I want the searchTemplate to auto start in the background, then user can select a user to query.&lt;BR /&gt;
When running the dashboard, the searchTemplate is run but the post process is not appended to the query.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;bleung_dashboard_search&amp;lt;/label&amp;gt;
  &amp;lt;description/&amp;gt;
  &amp;lt;searchTemplate&amp;gt;`audit_searchlocal` 
| convert num(total_run_time) 
| eval user = if(user="n/a", null(), user) 
| `audit_rexsearch` 
| eval is_scheduled = if(search_id LIKE "scheduler%", "yes", "no") 
| stats min(_time) as _time first(user) as user first(total_run_time) as total_run_time first(is_scheduled) as is_scheduled first(search) as search by search_id 
| search user=* 
| sort - total_run_time 
| fields - search_id
  &amp;lt;/searchTemplate&amp;gt;
    &amp;lt;earliestTime&amp;gt;-24h&amp;lt;/earliestTime&amp;gt;
    &amp;lt;latestTime&amp;gt;-1m&amp;lt;/latestTime&amp;gt;

  &amp;lt;fieldset submitButton="true"&amp;gt;
    &amp;lt;input type="dropdown" token="user"&amp;gt;
      &amp;lt;label&amp;gt;Users&amp;lt;/label&amp;gt;
      &amp;lt;choice value="admin"&amp;gt;admin&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="bleung"&amp;gt;bleung&amp;lt;/choice&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;searchPostProcess&amp;gt;search user=$user$&amp;lt;/searchPostProcess&amp;gt;
        &amp;lt;option name="wrap"&amp;gt;true&amp;lt;/option&amp;gt;
        &amp;lt;option name="rowNumbers"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="dataOverlayMode"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;cell&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Jun 2014 00:08:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/searchTemplate-and-searchPostProcess/m-p/190592#M11867</guid>
      <dc:creator>ben_leung</dc:creator>
      <dc:date>2014-06-06T00:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: searchTemplate and searchPostProcess</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/searchTemplate-and-searchPostProcess/m-p/190593#M11868</link>
      <description>&lt;P&gt;I am guessing that the searchTemplate and searchPostProcess is not featured in version 5 of Splunk?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jun 2014 00:28:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/searchTemplate-and-searchPostProcess/m-p/190593#M11868</guid>
      <dc:creator>ben_leung</dc:creator>
      <dc:date>2014-06-06T00:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: searchTemplate and searchPostProcess</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/searchTemplate-and-searchPostProcess/m-p/190594#M11869</link>
      <description>&lt;P&gt;When view results, stats table displays expected data. In dashboard, no results found.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jun 2014 00:45:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/searchTemplate-and-searchPostProcess/m-p/190594#M11869</guid>
      <dc:creator>ben_leung</dc:creator>
      <dc:date>2014-06-06T00:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: searchTemplate and searchPostProcess</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/searchTemplate-and-searchPostProcess/m-p/190595#M11870</link>
      <description>&lt;P&gt;Works in 6.1 and converted to advance xml, used the advance xml and tried on Splunk 5, same results. Clicking "View results" show the HiddenSearch but the HiddenPostProcess did not get searched, and no results shown on the dashboard itself.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jun 2014 15:26:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/searchTemplate-and-searchPostProcess/m-p/190595#M11870</guid>
      <dc:creator>ben_leung</dc:creator>
      <dc:date>2014-06-06T15:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: searchTemplate and searchPostProcess</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/searchTemplate-and-searchPostProcess/m-p/190596#M11871</link>
      <description>&lt;P&gt;The searchTemplate and searchPostProcess is available in Splunk 5.x but the searchPostProcess (OR HiddenPostProcess in advanced xml) doesn't support $foo$ tokens. You have to have static PostProcess search. (You can validate that by making your searchPostProcess query static value of 'search user="admin"' )&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jun 2014 15:41:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/searchTemplate-and-searchPostProcess/m-p/190596#M11871</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-06-06T15:41:27Z</dc:date>
    </item>
    <item>
      <title>Re: searchTemplate and searchPostProcess</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/searchTemplate-and-searchPostProcess/m-p/190597#M11872</link>
      <description>&lt;P&gt;Hi somesoni2, you are right about tokens not being supported. As you know the base search is grabbing all users. I wanted a drop-down to specify a user... I guess I could create individual panels for users and just have the top 5 results for each user. It would look messy though.&lt;/P&gt;

&lt;P&gt;Thanks for responding btw.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jun 2014 15:57:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/searchTemplate-and-searchPostProcess/m-p/190597#M11872</guid>
      <dc:creator>ben_leung</dc:creator>
      <dc:date>2014-06-06T15:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: searchTemplate and searchPostProcess</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/searchTemplate-and-searchPostProcess/m-p/190598#M11873</link>
      <description>&lt;P&gt;As said by somesoni2, tokens won't work with PostProcess in simple and advance xml. Instead of a static drop-down, creating individual panels for each option, until there is a workaround. &lt;/P&gt;</description>
      <pubDate>Fri, 06 Jun 2014 16:14:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/searchTemplate-and-searchPostProcess/m-p/190598#M11873</guid>
      <dc:creator>ben_leung</dc:creator>
      <dc:date>2014-06-06T16:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: searchTemplate and searchPostProcess</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/searchTemplate-and-searchPostProcess/m-p/190599#M11874</link>
      <description>&lt;P&gt;One workaround (to get rid of two panels) is to convert searchTemplate-searchPostProcess to a regular searchString within panel where the tokens work. &lt;/P&gt;

&lt;P&gt;e.g. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;bleung_dashboard_search&amp;lt;/label&amp;gt;
  &amp;lt;description/&amp;gt;
  &amp;lt;fieldset submitButton="true"&amp;gt;
    &amp;lt;input type="dropdown" token="user"&amp;gt;
      &amp;lt;label&amp;gt;Users&amp;lt;/label&amp;gt;
      &amp;lt;choice value="admin"&amp;gt;admin&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="bleung"&amp;gt;bleung&amp;lt;/choice&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
      &amp;lt;table&amp;gt;       
    &amp;lt;searchString&amp;gt;`audit_searchlocal` 
| convert num(total_run_time) 
| eval user = if(user="n/a", null(), user) 
| `audit_rexsearch` 
| eval is_scheduled = if(search_id LIKE "scheduler%", "yes", "no") 
| stats min(_time) as _time first(user) as user first(total_run_time) as total_run_time first(is_scheduled) as is_scheduled first(search) as search by search_id 
| search user=* 
| sort - total_run_time 
| fields - search_id |search user=$user$
  &amp;lt;/searchString&amp;gt;
    &amp;lt;earliestTime&amp;gt;-24h&amp;lt;/earliestTime&amp;gt;
    &amp;lt;latestTime&amp;gt;-1m&amp;lt;/latestTime&amp;gt;
        &amp;lt;option name="wrap"&amp;gt;true&amp;lt;/option&amp;gt;
        &amp;lt;option name="rowNumbers"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="dataOverlayMode"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;cell&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Jun 2014 16:30:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/searchTemplate-and-searchPostProcess/m-p/190599#M11874</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-06-06T16:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: searchTemplate and searchPostProcess</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/searchTemplate-and-searchPostProcess/m-p/190600#M11875</link>
      <description>&lt;P&gt;Yea this is how I started, I wanted to make make the base search populate first because I will have 10-15 static options/users to select. I do not plan on running the search every time when a user is selected.&lt;/P&gt;

&lt;P&gt;Also thought of creating a scheduled saved search, but just wanted to get results when needed.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jun 2014 16:34:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/searchTemplate-and-searchPostProcess/m-p/190600#M11875</guid>
      <dc:creator>ben_leung</dc:creator>
      <dc:date>2014-06-06T16:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: searchTemplate and searchPostProcess</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/searchTemplate-and-searchPostProcess/m-p/190601#M11876</link>
      <description>&lt;P&gt;Any chance you'd consider using advanced xml? With advanced xml along with Sideview Utils, you can achieve what you want here.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jun 2014 16:42:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/searchTemplate-and-searchPostProcess/m-p/190601#M11876</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-06-06T16:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: searchTemplate and searchPostProcess</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/searchTemplate-and-searchPostProcess/m-p/190602#M11877</link>
      <description>&lt;P&gt;@somesoni2&lt;BR /&gt;
I used one of the examples in Sideview app and create a more dynamic approach. Let me know what you think!&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;view autoCancelInterval="90" decomposeIntentions="false" isPersistable="true" isSticky="false" isVisible="true" objectMode="viewconf" onunloadCancelJobs="true" template="dashboard.html"&amp;gt;
  &amp;lt;label&amp;gt;bleung_dashboard_search&amp;lt;/label&amp;gt;
  &amp;lt;module name="AccountBar" layoutPanel="appHeader"/&amp;gt;
  &amp;lt;module name="AppBar" layoutPanel="appHeader"/&amp;gt;
  &amp;lt;module name="SideviewUtils" layoutPanel="appHeader"/&amp;gt;
  &amp;lt;module name="Message" layoutPanel="messaging"&amp;gt;
    &amp;lt;param name="maxSize"&amp;gt;2&amp;lt;/param&amp;gt;
    &amp;lt;param name="clearOnJobDispatch"&amp;gt;False&amp;lt;/param&amp;gt;
    &amp;lt;param name="filter"&amp;gt;*&amp;lt;/param&amp;gt;
  &amp;lt;/module&amp;gt;
  &amp;lt;module name="HTML" layoutPanel="viewHeader"&amp;gt;
    &amp;lt;param name="html"&amp;gt;&amp;amp;lt;h1&amp;amp;gt;User Search&amp;amp;lt;/h1&amp;amp;gt;&amp;lt;/param&amp;gt;
  &amp;lt;/module&amp;gt;
  &amp;lt;module name="TextField" layoutPanel="panel_row1_col1" autoRun="True"&amp;gt;
    &amp;lt;param name="name"&amp;gt;searchString&amp;lt;/param&amp;gt;
    &amp;lt;param name="default"&amp;gt;`audit_searchlocal` 
| convert num(total_run_time) 
| eval user = if(user="n/a", null(), user) 
| `audit_rexsearch` 
| eval is_scheduled = if(search_id LIKE "scheduler%", "yes", "no") 
| stats min(_time) as _time first(user) as user first(total_run_time) as total_run_time first(is_scheduled) as is_scheduled first(search) as search by search_id 
| search user=* 
| sort - total_run_time 
| fields - search_id
    &amp;lt;/param&amp;gt;
    &amp;lt;param name="label"&amp;gt;Search&amp;lt;/param&amp;gt;
    &amp;lt;param name="width"&amp;gt;350px&amp;lt;/param&amp;gt;
    &amp;lt;module name="Button"&amp;gt;
      &amp;lt;param name="allowSoftSubmit"&amp;gt;True&amp;lt;/param&amp;gt;
      &amp;lt;param name="label"&amp;gt;Search&amp;lt;/param&amp;gt;
      &amp;lt;module name="Search"&amp;gt;
        &amp;lt;param name="latest"&amp;gt;now&amp;lt;/param&amp;gt;
        &amp;lt;param name="search"&amp;gt;$searchString$&amp;lt;/param&amp;gt;
        &amp;lt;param name="earliest"&amp;gt;-24h&amp;lt;/param&amp;gt;
        &amp;lt;module name="HTML"&amp;gt;
          &amp;lt;param name="html"&amp;gt;$results.count$ search results found&amp;lt;/param&amp;gt;
        &amp;lt;/module&amp;gt;
        &amp;lt;module name="JobProgressIndicator"/&amp;gt;
        &amp;lt;module name="TextField"&amp;gt;
          &amp;lt;param name="name"&amp;gt;postProcessString&amp;lt;/param&amp;gt;
          &amp;lt;param name="default"&amp;gt;search user=admin | head 5&amp;lt;/param&amp;gt;
          &amp;lt;param name="label"&amp;gt;Post Process&amp;lt;/param&amp;gt;
          &amp;lt;param name="width"&amp;gt;300px&amp;lt;/param&amp;gt;
          &amp;lt;module name="Button"&amp;gt;
            &amp;lt;param name="allowSoftSubmit"&amp;gt;True&amp;lt;/param&amp;gt;
            &amp;lt;param name="label"&amp;gt;Filter&amp;lt;/param&amp;gt;
            &amp;lt;module name="PostProcess"&amp;gt;
              &amp;lt;param name="search"&amp;gt;$postProcessString$&amp;lt;/param&amp;gt;
              &amp;lt;module name="Pulldown"&amp;gt;
                &amp;lt;param name="name"&amp;gt;results.count&amp;lt;/param&amp;gt;
                &amp;lt;param name="staticOptions"&amp;gt;
                  &amp;lt;list&amp;gt;
                    &amp;lt;param name="value"&amp;gt;10&amp;lt;/param&amp;gt;
                  &amp;lt;/list&amp;gt;
                  &amp;lt;list&amp;gt;
                    &amp;lt;param name="value"&amp;gt;20&amp;lt;/param&amp;gt;
                  &amp;lt;/list&amp;gt;
                  &amp;lt;list&amp;gt;
                    &amp;lt;param name="value"&amp;gt;50&amp;lt;/param&amp;gt;
                  &amp;lt;/list&amp;gt;
                  &amp;lt;list&amp;gt;
                    &amp;lt;param name="selected"&amp;gt;True&amp;lt;/param&amp;gt;
                    &amp;lt;param name="value"&amp;gt;100&amp;lt;/param&amp;gt;
                  &amp;lt;/list&amp;gt;
                &amp;lt;/param&amp;gt;
                &amp;lt;param name="label"&amp;gt;results per page&amp;lt;/param&amp;gt;
                &amp;lt;param name="float"&amp;gt;right&amp;lt;/param&amp;gt;
                &amp;lt;module name="PostProcess"&amp;gt;
                  &amp;lt;param name="search"&amp;gt;$postProcess$ | stats count&amp;lt;/param&amp;gt;
                  &amp;lt;module name="HTML"&amp;gt;
                    &amp;lt;param name="html"&amp;gt;$results[0].count$ postprocessed results found&amp;lt;/param&amp;gt;
                  &amp;lt;/module&amp;gt;
                &amp;lt;/module&amp;gt;
                &amp;lt;module name="Pager"&amp;gt;
                  &amp;lt;module name="Table"/&amp;gt;
                  &amp;lt;module name="Pager"/&amp;gt;
                &amp;lt;/module&amp;gt;
              &amp;lt;/module&amp;gt;
            &amp;lt;/module&amp;gt;
          &amp;lt;/module&amp;gt;
        &amp;lt;/module&amp;gt;
      &amp;lt;/module&amp;gt;
    &amp;lt;/module&amp;gt;
  &amp;lt;/module&amp;gt;
&amp;lt;/view&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Jun 2014 17:59:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/searchTemplate-and-searchPostProcess/m-p/190602#M11877</guid>
      <dc:creator>ben_leung</dc:creator>
      <dc:date>2014-06-06T17:59:32Z</dc:date>
    </item>
  </channel>
</rss>

