<?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 for multiple values in field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Search-for-multiple-values-in-field/m-p/371243#M162076</link>
    <description>&lt;P&gt;If your list is going to grow, you'd be very smart to follow @niketnilay's advice and set up a lookup table. His search structure will handle the formatting, too. &lt;/P&gt;</description>
    <pubDate>Thu, 22 Mar 2018 20:33:09 GMT</pubDate>
    <dc:creator>elliotproebstel</dc:creator>
    <dc:date>2018-03-22T20:33:09Z</dc:date>
    <item>
      <title>Search for multiple values in field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-for-multiple-values-in-field/m-p/371239#M162072</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I am trying to omit search results for a field that might have a couple of different values. &lt;BR /&gt;
any ideas how to best do this?  Is EVAL or LIKE the way to go? &lt;/P&gt;

&lt;P&gt;Here's some sample data:&lt;BR /&gt;
computerdisconnected="[bob sbr] [tube tue]"&lt;BR /&gt;
computerdisconnected="[tube tue]"&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;condition-&lt;/STRONG&gt;&lt;BR /&gt;
If the computerdisconnected contains any values like "bob or "Tube" then don't return any results.  &lt;/P&gt;

&lt;P&gt;In other words I am getting regular reminders that these machines are disconnected, I only want NEW results so I want to keep a list of repeat offenders and ignore them.&lt;/P&gt;

&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Wed, 21 Mar 2018 22:23:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-for-multiple-values-in-field/m-p/371239#M162072</guid>
      <dc:creator>banzen</dc:creator>
      <dc:date>2018-03-21T22:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: Search for multiple values in field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-for-multiple-values-in-field/m-p/371240#M162073</link>
      <description>&lt;P&gt;Do all the potential values for &lt;CODE&gt;computerdisconnected&lt;/CODE&gt; get formatted like that? If so, this might work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search NOT "[bob*" OR "[tube*"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So that's literally whatever you're searching for right now followed immediately by &lt;CODE&gt;NOT "[bob*" OR "[tube*"&lt;/CODE&gt;. The opening square brackets matter, I believe.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Mar 2018 01:03:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-for-multiple-values-in-field/m-p/371240#M162073</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-03-22T01:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: Search for multiple values in field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-for-multiple-values-in-field/m-p/371241#M162074</link>
      <description>&lt;P&gt;Agree with @elliotproebstel and to add on I would move such patterns to lookup file&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;YourBaseSearch&amp;gt; NOT
    [| inputookup &amp;lt;yourLookupFileName&amp;gt;.csv 
     | eval &amp;lt;yourLookupFiledName&amp;gt;="*".&amp;lt;yourLookupFiledName&amp;gt;."*"
    | rename &amp;lt;yourLookupFiledName&amp;gt; as search]
| &amp;lt;yourRemainingSearch&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Following is a sample search based on the data that you have provided (PS: &lt;CODE&gt;makeresults&lt;/CODE&gt; used instead of inputlookup to mock up the terms to be filtered from search.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;YourBaseSearch&amp;gt; NOT
    [| makeresults
    | eval lookupData="bob,tube"
    | makemv lookupData delim=","
    | mvexpand lookupData
    | eval lookupData="*".lookupData."*"
    | rename lookupData as search]
| &amp;lt;yourRemainingSearch&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Mar 2018 06:10:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-for-multiple-values-in-field/m-p/371241#M162074</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-03-22T06:10:28Z</dc:date>
    </item>
    <item>
      <title>Re: Search for multiple values in field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-for-multiple-values-in-field/m-p/371242#M162075</link>
      <description>&lt;P&gt;And if my list continues to grow, just keep adding OR statements? OR " " OR "" OR "" ? I can do do this, just thought there was a cleaner way, like  anything &lt;BR /&gt;
 LIKE or IN ("bob*,"tube*", "next*")  &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:38:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-for-multiple-values-in-field/m-p/371242#M162075</guid>
      <dc:creator>banzen</dc:creator>
      <dc:date>2020-09-29T18:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: Search for multiple values in field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-for-multiple-values-in-field/m-p/371243#M162076</link>
      <description>&lt;P&gt;If your list is going to grow, you'd be very smart to follow @niketnilay's advice and set up a lookup table. His search structure will handle the formatting, too. &lt;/P&gt;</description>
      <pubDate>Thu, 22 Mar 2018 20:33:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-for-multiple-values-in-field/m-p/371243#M162076</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-03-22T20:33:09Z</dc:date>
    </item>
  </channel>
</rss>

