<?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: Search query to retrive host upon selection in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Search-query-to-retrive-host-upon-selection/m-p/257156#M76996</link>
    <description>&lt;P&gt;If you are able to search events like &lt;CODE&gt;index=yourIndex sourcetype=yourScourcetype "11.2" (host=host1 OR host=host2)&lt;/CODE&gt; to return all events of version 11.2 for hosts host1 or host2 then follow the below approach and ensure you have following points covered: &lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Take a note of the token for your dropdown, I will call it &lt;CODE&gt;tok_dropdown_version&lt;/CODE&gt;&lt;/LI&gt;
&lt;LI&gt;Take a note of the token for your multiselect, I will call it &lt;CODE&gt;myToken&lt;/CODE&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://answers.splunk.com/answers/482462/multi-select-parameter-on-a-dashboard.html#answer-482465"&gt;Take a note of this answer on multiselect&lt;/A&gt; which tells you how to form a query of type (field1=value1 OR field1=value2) which in your case will be &lt;CODE&gt;host=host1 OR host=host2 and so on&lt;/CODE&gt; (however many values will be selected from multiselect).&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;With these three as arsenal then your final query shall be like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=yourIndex sourcetype=yourSourcetype $tok_dropdown_version$ ($myToken$)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 30 Jan 2017 06:44:44 GMT</pubDate>
    <dc:creator>gokadroid</dc:creator>
    <dc:date>2017-01-30T06:44:44Z</dc:date>
    <item>
      <title>Search query to retrive host upon selection</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-query-to-retrive-host-upon-selection/m-p/257155#M76995</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have 2 versions with multiple hosts containing dev and stg environment&lt;BR /&gt;
 version1 is 7.2  with host1, host2,... host10(5 dev &amp;amp; 5 stg hosts)&lt;BR /&gt;
 version2 is 8.1 with host1, host2,....host10(3 dev &amp;amp; 7 stg hosts)&lt;/P&gt;

&lt;P&gt;I have created dropdown for version(11.2,12.1) and multiselect for enviornment(dev,stg) .&lt;BR /&gt;
What will be the search query to retrieve host based on selection (for ex :- version1 and stg env )&lt;/P&gt;</description>
      <pubDate>Sun, 29 Jan 2017 22:17:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-query-to-retrive-host-upon-selection/m-p/257155#M76995</guid>
      <dc:creator>imthesplunker</dc:creator>
      <dc:date>2017-01-29T22:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: Search query to retrive host upon selection</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-query-to-retrive-host-upon-selection/m-p/257156#M76996</link>
      <description>&lt;P&gt;If you are able to search events like &lt;CODE&gt;index=yourIndex sourcetype=yourScourcetype "11.2" (host=host1 OR host=host2)&lt;/CODE&gt; to return all events of version 11.2 for hosts host1 or host2 then follow the below approach and ensure you have following points covered: &lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Take a note of the token for your dropdown, I will call it &lt;CODE&gt;tok_dropdown_version&lt;/CODE&gt;&lt;/LI&gt;
&lt;LI&gt;Take a note of the token for your multiselect, I will call it &lt;CODE&gt;myToken&lt;/CODE&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://answers.splunk.com/answers/482462/multi-select-parameter-on-a-dashboard.html#answer-482465"&gt;Take a note of this answer on multiselect&lt;/A&gt; which tells you how to form a query of type (field1=value1 OR field1=value2) which in your case will be &lt;CODE&gt;host=host1 OR host=host2 and so on&lt;/CODE&gt; (however many values will be selected from multiselect).&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;With these three as arsenal then your final query shall be like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=yourIndex sourcetype=yourSourcetype $tok_dropdown_version$ ($myToken$)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Jan 2017 06:44:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-query-to-retrive-host-upon-selection/m-p/257156#M76996</guid>
      <dc:creator>gokadroid</dc:creator>
      <dc:date>2017-01-30T06:44:44Z</dc:date>
    </item>
    <item>
      <title>Re: Search query to retrive host upon selection</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-query-to-retrive-host-upon-selection/m-p/257157#M76997</link>
      <description>&lt;P&gt;This helped me .thanks&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2017 19:28:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-query-to-retrive-host-upon-selection/m-p/257157#M76997</guid>
      <dc:creator>imthesplunker</dc:creator>
      <dc:date>2017-01-30T19:28:28Z</dc:date>
    </item>
  </channel>
</rss>

