<?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 Dynamic referring to base search - based on dropdown in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-referring-to-base-search-based-on-dropdown/m-p/202885#M12724</link>
    <description>&lt;P&gt;Is it possible to refer to a specific base search in you dashboard, by use of a token (input dropdown).&lt;/P&gt;

&lt;P&gt;For instance, when having two basesearches I want to refer to either one of them by using a token in my postprocess search.&lt;BR /&gt;
This however doesn't seem to work, see example below,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;form&amp;gt;
     &amp;lt;search id="BS_Windows"&amp;gt;
      &amp;lt;query&amp;gt;SOMEQUERY&amp;lt;/query&amp;gt;
     &amp;lt;/search&amp;gt;
     &amp;lt;search id="BS_Linux"&amp;gt;
      &amp;lt;query&amp;gt;SOMEQUERY2&amp;lt;/query&amp;gt;
     &amp;lt;/search&amp;gt;

     &amp;lt;row&amp;gt;
      &amp;lt;panel&amp;gt;
        &amp;lt;input type="dropdown" token="selectedOS" searchWhenChanged="true"&amp;gt;
          &amp;lt;label&amp;gt;Service Provider&amp;lt;/label&amp;gt;
            &amp;lt;choice value="BS_Windows"&amp;gt;Windows&amp;lt;/choice&amp;gt;
           &amp;lt;choice value="BS_Linux"&amp;gt;Linux&amp;lt;/choice&amp;gt;
        &amp;lt;/input&amp;gt;
      &amp;lt;single&amp;gt;
       &amp;lt;title&amp;gt;Windows Compliancy&amp;lt;/title&amp;gt;
        &amp;lt;search base="$selectedOS$"&amp;gt;
         &amp;lt;query&amp;gt;VISUALIZATION&amp;lt;/query&amp;gt;
        &amp;lt;/search&amp;gt;
     &amp;lt;/panel&amp;gt;
   &amp;lt;/row&amp;gt;
...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 21 Sep 2016 12:26:17 GMT</pubDate>
    <dc:creator>kschaul</dc:creator>
    <dc:date>2016-09-21T12:26:17Z</dc:date>
    <item>
      <title>Dynamic referring to base search - based on dropdown</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-referring-to-base-search-based-on-dropdown/m-p/202885#M12724</link>
      <description>&lt;P&gt;Is it possible to refer to a specific base search in you dashboard, by use of a token (input dropdown).&lt;/P&gt;

&lt;P&gt;For instance, when having two basesearches I want to refer to either one of them by using a token in my postprocess search.&lt;BR /&gt;
This however doesn't seem to work, see example below,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;form&amp;gt;
     &amp;lt;search id="BS_Windows"&amp;gt;
      &amp;lt;query&amp;gt;SOMEQUERY&amp;lt;/query&amp;gt;
     &amp;lt;/search&amp;gt;
     &amp;lt;search id="BS_Linux"&amp;gt;
      &amp;lt;query&amp;gt;SOMEQUERY2&amp;lt;/query&amp;gt;
     &amp;lt;/search&amp;gt;

     &amp;lt;row&amp;gt;
      &amp;lt;panel&amp;gt;
        &amp;lt;input type="dropdown" token="selectedOS" searchWhenChanged="true"&amp;gt;
          &amp;lt;label&amp;gt;Service Provider&amp;lt;/label&amp;gt;
            &amp;lt;choice value="BS_Windows"&amp;gt;Windows&amp;lt;/choice&amp;gt;
           &amp;lt;choice value="BS_Linux"&amp;gt;Linux&amp;lt;/choice&amp;gt;
        &amp;lt;/input&amp;gt;
      &amp;lt;single&amp;gt;
       &amp;lt;title&amp;gt;Windows Compliancy&amp;lt;/title&amp;gt;
        &amp;lt;search base="$selectedOS$"&amp;gt;
         &amp;lt;query&amp;gt;VISUALIZATION&amp;lt;/query&amp;gt;
        &amp;lt;/search&amp;gt;
     &amp;lt;/panel&amp;gt;
   &amp;lt;/row&amp;gt;
...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Sep 2016 12:26:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-referring-to-base-search-based-on-dropdown/m-p/202885#M12724</guid>
      <dc:creator>kschaul</dc:creator>
      <dc:date>2016-09-21T12:26:17Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic referring to base search - based on dropdown</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-referring-to-base-search-based-on-dropdown/m-p/202886#M12725</link>
      <description>&lt;P&gt;If the difference between the two base searches is more than just one value (sourcetype) you could create two panels - Windows / Linux and show/hide them based on user selection in the dropdown. Something like this may work...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;row&amp;gt;
   &amp;lt;panel&amp;gt;
     &amp;lt;input type="dropdown" token="selectedOS" searchWhenChanged="true"&amp;gt;
       &amp;lt;label&amp;gt;Service Provider&amp;lt;/label&amp;gt;
         &amp;lt;choice value="Windows"&amp;gt;Windows&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="Linux"&amp;gt;Linux&amp;lt;/choice&amp;gt;
        &amp;lt;change&amp;gt;&amp;lt;condition value="Windows"&amp;gt;&amp;lt;set token="BS_Windows"&amp;gt;Windows&amp;lt;/set&amp;gt;&amp;lt;unset token="BS_Linux" /&amp;gt;&amp;lt;/condition&amp;gt;
      &amp;lt;condition value="Linux"&amp;gt;&amp;lt;set token="BS_Linux"&amp;gt;Linux&amp;lt;/set&amp;gt;&amp;lt;unset token="BS_Windows" /&amp;gt;&amp;lt;/condition&amp;gt;
     &amp;lt;/input&amp;gt;
   &amp;lt;panel depends="$BS_Windows$"&amp;gt;
    &amp;lt;title&amp;gt;Windows Compliance&amp;lt;/title&amp;gt; --&amp;gt; Make sure you add an `eval temp="$BS_Windows$"` to your query to prevent the execution if token not set.
      &amp;lt;query&amp;gt;VISUALIZATION&amp;lt;/query&amp;gt;
     &amp;lt;/search&amp;gt;
  &amp;lt;/panel&amp;gt;
   &amp;lt;panel depends="$BS_Linux$"&amp;gt;
    &amp;lt;title&amp;gt;Windows Compliance&amp;lt;/title&amp;gt; --&amp;gt; Make sure you add an `eval temp="$BS_Linux$"` to your query to prevent the execution if token not set.
      &amp;lt;query&amp;gt;VISUALIZATION&amp;lt;/query&amp;gt;
     &amp;lt;/search&amp;gt;
  &amp;lt;/panel&amp;gt;
&amp;lt;/row&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If it is only one value, you can use token in the base search itself. `index=xyz sourcetype="$selectedOS$"&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2016 13:00:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dynamic-referring-to-base-search-based-on-dropdown/m-p/202886#M12725</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-09-21T13:00:03Z</dc:date>
    </item>
  </channel>
</rss>

