<?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: Setting search term based on dropdown selection in dashboard in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Setting-search-term-based-on-dropdown-selection-in-dashboard/m-p/128602#M7613</link>
    <description>&lt;P&gt;Use tokens, See in your XML above it says token="_environmentSelected" so in your search where you want the string to appear just place $_environmentSelected$&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 19:25:50 GMT</pubDate>
    <dc:creator>dolivasoh</dc:creator>
    <dc:date>2020-09-28T19:25:50Z</dc:date>
    <item>
      <title>Setting search term based on dropdown selection in dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Setting-search-term-based-on-dropdown-selection-in-dashboard/m-p/128601#M7612</link>
      <description>&lt;P&gt;I have a dashboard with thre saved searches for three server environments. The searches only differ based on which environment the search matches. What I want to do is make it so that a dropdown can be used to set a search term to specify the environment to search against rather than having a separate saved search for each environment. The environment an entry came from is determined by a substring of the host name that exists for test or beta environments but not production.&lt;/P&gt;

&lt;P&gt;For example I would want to set the following search terms based on the selected value&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Test is selected: "host=*Test*"
Beta is selected: "host=*Beta*"
Test is selected: "NOT host=*Test* NOT host=*Beta*"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I can probably do the matching more efficiently, but that's another mater.&lt;/P&gt;

&lt;P&gt;Here is what my current saved search looks like for the test environment: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="C:\\Logs\\*.log"
     host=*Test* 
     level=Error 
|cluster showcount=t field=ExceptionStackTrace t=0.9 
|  sort - cluster_count 
|  table ExceptionType ExceptionMessage ExceptionStackTrace cluster_count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How can I make my search reference the selected dropdown value?&lt;/P&gt;

&lt;P&gt;I created dropdown with the following XML:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="dropdown" token="_environmentSelected" searchWhenChanged="true"&amp;gt;
    &amp;lt;label&amp;gt;Environment&amp;lt;/label&amp;gt;
    &amp;lt;choice value="host=*UTT*"&amp;gt;Test&amp;lt;/choice&amp;gt;
    &amp;lt;choice value="host=*UTS*"&amp;gt;Stage&amp;lt;/choice&amp;gt;
    &amp;lt;choice value="NOT host=*UT*"&amp;gt;Production&amp;lt;/choice&amp;gt;
&amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How do I reference the selected dropdown value in the search?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2015 21:36:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Setting-search-term-based-on-dropdown-selection-in-dashboard/m-p/128601#M7612</guid>
      <dc:creator>iceburg47</dc:creator>
      <dc:date>2015-04-06T21:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: Setting search term based on dropdown selection in dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Setting-search-term-based-on-dropdown-selection-in-dashboard/m-p/128602#M7613</link>
      <description>&lt;P&gt;Use tokens, See in your XML above it says token="_environmentSelected" so in your search where you want the string to appear just place $_environmentSelected$&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:25:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Setting-search-term-based-on-dropdown-selection-in-dashboard/m-p/128602#M7613</guid>
      <dc:creator>dolivasoh</dc:creator>
      <dc:date>2020-09-28T19:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: Setting search term based on dropdown selection in dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Setting-search-term-based-on-dropdown-selection-in-dashboard/m-p/128603#M7614</link>
      <description>&lt;P&gt;P.S. I'm not sure why "5." is appearing in two of my code snippets.  Please ignore that.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2015 21:38:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Setting-search-term-based-on-dropdown-selection-in-dashboard/m-p/128603#M7614</guid>
      <dc:creator>iceburg47</dc:creator>
      <dc:date>2015-04-06T21:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: Setting search term based on dropdown selection in dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Setting-search-term-based-on-dropdown-selection-in-dashboard/m-p/128604#M7615</link>
      <description>&lt;P&gt;Thank you so much. I feel rather silly, I had missed surrounding the token name with $.  Thanks again!&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2015 21:40:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Setting-search-term-based-on-dropdown-selection-in-dashboard/m-p/128604#M7615</guid>
      <dc:creator>iceburg47</dc:creator>
      <dc:date>2015-04-06T21:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Setting search term based on dropdown selection in dashboard</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Setting-search-term-based-on-dropdown-selection-in-dashboard/m-p/128605#M7616</link>
      <description>&lt;P&gt;No Problem. Happy Splunking!&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2015 17:28:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Setting-search-term-based-on-dropdown-selection-in-dashboard/m-p/128605#M7616</guid>
      <dc:creator>dolivasoh</dc:creator>
      <dc:date>2015-04-07T17:28:47Z</dc:date>
    </item>
  </channel>
</rss>

