<?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: Field in Lookup Table with Multiple Values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Field-in-Lookup-Table-with-Multiple-Values/m-p/242892#M72271</link>
    <description>&lt;P&gt;You can use dynamic tokens. Something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type=dropdown&amp;gt;
&amp;lt;change&amp;gt;
&amp;lt;eval token="hosts"&amp;gt;replace($value$, " OR ", " OR host=")&amp;lt;/eval&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 01 Jul 2016 16:57:47 GMT</pubDate>
    <dc:creator>sundareshr</dc:creator>
    <dc:date>2016-07-01T16:57:47Z</dc:date>
    <item>
      <title>Field in Lookup Table with Multiple Values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-in-Lookup-Table-with-Multiple-Values/m-p/242888#M72267</link>
      <description>&lt;P&gt;In one of the columns of my lookup table, host, some values have two hosts rather than just one.&lt;/P&gt;

&lt;P&gt;For example, my table might look like this&lt;BR /&gt;
app,environment,host&lt;BR /&gt;
app1,env1,host1&lt;BR /&gt;
app1,env2,host1 OR host2&lt;BR /&gt;
...&lt;/P&gt;

&lt;P&gt;In my dashboard panel, I am writing a query that would search for all events with the selected environment and host. However, for the ones with two hosts, the search query only searches for the first host. How would I be able to search for both?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2016 15:28:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-in-Lookup-Table-with-Multiple-Values/m-p/242888#M72267</guid>
      <dc:creator>alan20854</dc:creator>
      <dc:date>2016-07-01T15:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: Field in Lookup Table with Multiple Values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-in-Lookup-Table-with-Multiple-Values/m-p/242889#M72268</link>
      <description>&lt;P&gt;If you have control over the lookup table, consider a separate row for the extra host.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;app,environment,host
app1,env1,host1
app1,env2,host1
app1,env2,host2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Jul 2016 15:47:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-in-Lookup-Table-with-Multiple-Values/m-p/242889#M72268</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2016-07-01T15:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: Field in Lookup Table with Multiple Values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-in-Lookup-Table-with-Multiple-Values/m-p/242890#M72269</link>
      <description>&lt;P&gt;Hi Rich,&lt;/P&gt;

&lt;P&gt;I am using the lookup table to populate my dropdowns, but I do not want to create another dropdown for host. Is there a way to search for both hosts now that they are in separate rows?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2016 15:52:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-in-Lookup-Table-with-Multiple-Values/m-p/242890#M72269</guid>
      <dc:creator>alan20854</dc:creator>
      <dc:date>2016-07-01T15:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: Field in Lookup Table with Multiple Values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-in-Lookup-Table-with-Multiple-Values/m-p/242891#M72270</link>
      <description>&lt;P&gt;I didn't get the part where you were populating a dropdown.  This answer won't help with that.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2016 16:15:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-in-Lookup-Table-with-Multiple-Values/m-p/242891#M72270</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2016-07-01T16:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: Field in Lookup Table with Multiple Values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-in-Lookup-Table-with-Multiple-Values/m-p/242892#M72271</link>
      <description>&lt;P&gt;You can use dynamic tokens. Something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type=dropdown&amp;gt;
&amp;lt;change&amp;gt;
&amp;lt;eval token="hosts"&amp;gt;replace($value$, " OR ", " OR host=")&amp;lt;/eval&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Jul 2016 16:57:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-in-Lookup-Table-with-Multiple-Values/m-p/242892#M72271</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-07-01T16:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: Field in Lookup Table with Multiple Values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-in-Lookup-Table-with-Multiple-Values/m-p/242893#M72272</link>
      <description>&lt;P&gt;Would this be the same for if I just had static options in my dropdown?&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2016 17:20:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-in-Lookup-Table-with-Multiple-Values/m-p/242893#M72272</guid>
      <dc:creator>alan20854</dc:creator>
      <dc:date>2016-07-05T17:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: Field in Lookup Table with Multiple Values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-in-Lookup-Table-with-Multiple-Values/m-p/242894#M72273</link>
      <description>&lt;P&gt;I tried to do what you suggested, but it didn't seem to change my search query when I opened it up in search. Here is the XML:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;input type="dropdown" token="env" searchWhenChanged="true"&amp;gt;
  &amp;lt;label&amp;gt;Environment&amp;lt;/label&amp;gt;
  &amp;lt;choice value="host1 OR host2 OR host3"&amp;gt;PROD&amp;lt;/choice&amp;gt;
  &amp;lt;choice value="host1 OR host4"&amp;gt;QA&amp;lt;/choice&amp;gt;
  &amp;lt;choice value="host5"&amp;gt;QI1&amp;lt;/choice&amp;gt;
  &amp;lt;choice value="host5 OR host6"&amp;gt;QI2&amp;lt;/choice&amp;gt;
  &amp;lt;choice value="host7"&amp;gt;QC1&amp;lt;/choice&amp;gt;
  &amp;lt;change&amp;gt;
    &amp;lt;eval token="hosts"&amp;gt;replace($value$, " OR ", " OR host=")&amp;lt;/eval&amp;gt;
  &amp;lt;/change&amp;gt;
&amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Jul 2016 17:35:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-in-Lookup-Table-with-Multiple-Values/m-p/242894#M72273</guid>
      <dc:creator>alan20854</dc:creator>
      <dc:date>2016-07-05T17:35:04Z</dc:date>
    </item>
    <item>
      <title>Re: Field in Lookup Table with Multiple Values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-in-Lookup-Table-with-Multiple-Values/m-p/242895#M72274</link>
      <description>&lt;P&gt;And my search query is: host = $env$ ...&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2016 18:00:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-in-Lookup-Table-with-Multiple-Values/m-p/242895#M72274</guid>
      <dc:creator>alan20854</dc:creator>
      <dc:date>2016-07-05T18:00:08Z</dc:date>
    </item>
    <item>
      <title>Re: Field in Lookup Table with Multiple Values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-in-Lookup-Table-with-Multiple-Values/m-p/242896#M72275</link>
      <description>&lt;P&gt;If these are static values, your best option would be change the values to &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   &amp;lt;choice value="host=host1 OR host=host2 OR host=host3"&amp;gt;PROD&amp;lt;/choice&amp;gt;
   &amp;lt;choice value="host=host1 OR host=host4"&amp;gt;QA&amp;lt;/choice&amp;gt;
   &amp;lt;choice value="host=host5"&amp;gt;QI1&amp;lt;/choice&amp;gt;
   &amp;lt;choice value="host=host5 OR host=host6"&amp;gt;QI2&amp;lt;/choice&amp;gt;
   &amp;lt;choice value="host=host7"&amp;gt;QC1&amp;lt;/choice&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If these are dynamically populated, you could add the &lt;CODE&gt;host=&lt;/CODE&gt; in the query that is populating the dropdown. &lt;/P&gt;

&lt;P&gt;The other option is to use &lt;CODE&gt;tags&lt;/CODE&gt; in your data and in the dropdowns &lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Defineandusetags"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Defineandusetags&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2016 18:03:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-in-Lookup-Table-with-Multiple-Values/m-p/242896#M72275</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-07-05T18:03:25Z</dc:date>
    </item>
    <item>
      <title>Re: Field in Lookup Table with Multiple Values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-in-Lookup-Table-with-Multiple-Values/m-p/242897#M72276</link>
      <description>&lt;P&gt;Thanks for the help!&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2016 18:06:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-in-Lookup-Table-with-Multiple-Values/m-p/242897#M72276</guid>
      <dc:creator>alan20854</dc:creator>
      <dc:date>2016-07-05T18:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: Field in Lookup Table with Multiple Values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-in-Lookup-Table-with-Multiple-Values/m-p/242898#M72277</link>
      <description>&lt;P&gt;Way late to the game, but for anyone that is looking for something like this, you may try insert this in your search. It will make the host field multivalue based on the comma. &lt;BR /&gt;
    | inputlookup &lt;YOURLOOKUP.CSV&gt;&lt;BR /&gt;
    | makemv delim="," host&lt;/YOURLOOKUP.CSV&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 15:29:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-in-Lookup-Table-with-Multiple-Values/m-p/242898#M72277</guid>
      <dc:creator>jbillings</dc:creator>
      <dc:date>2020-03-02T15:29:40Z</dc:date>
    </item>
  </channel>
</rss>

