<?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: eval match with NOT condition in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/eval-match-with-NOT-condition/m-p/350899#M103873</link>
    <description>&lt;P&gt;@kmaron, to mark this question as answered, please accept the answer if this has helped.&lt;/P&gt;</description>
    <pubDate>Fri, 20 Apr 2018 12:16:59 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2018-04-20T12:16:59Z</dc:date>
    <item>
      <title>eval match with NOT condition</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-match-with-NOT-condition/m-p/350893#M103867</link>
      <description>&lt;P&gt;I've figured out how to use the match condition to use a wildcard in my eval, however now I need to put at NOT with it and I'm stuck. &lt;/P&gt;

&lt;P&gt;I have this which works&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval NewDocType = case(match(Indexer,"ID*"),Document_Type)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But now I need the opposite where Indexer does NOT start with ID* to fill the field OriginalDocType with the Document_Type&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2018 20:24:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-match-with-NOT-condition/m-p/350893#M103867</guid>
      <dc:creator>kmaron</dc:creator>
      <dc:date>2018-04-19T20:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: eval match with NOT condition</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-match-with-NOT-condition/m-p/350894#M103868</link>
      <description>&lt;P&gt;Just do like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval NewDocType = case(NOT match(Indexer,"^ID"),Document_Type)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;With match you can do partial match, no wildcard required. It actually uses regular expression (not like search wildcard), so your current expression will match all Indexer with which have &lt;CODE&gt;ID*&lt;/CODE&gt; (0 or more occurrence of alphabet D)&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2018 20:49:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-match-with-NOT-condition/m-p/350894#M103868</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-04-19T20:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: eval match with NOT condition</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-match-with-NOT-condition/m-p/350895#M103869</link>
      <description>&lt;P&gt;@kmaron, try the following match condition for finding &lt;CODE&gt;indexers not starting with ID&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval OriginalDocType=case(match(indexer,"^(?!^ID).*"),DocumentType)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Following is a run anywhere example.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| fields - _time
| eval indexer="ID3489724,SID203984,IDKJERH897,ADID90842ID"
| makemv indexer delim=","
| mvexpand indexer
| eval DocumentType="Test"
| eval OriginalDocType=case(match(indexer,"^(?!^ID).*"),DocumentType)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 Apr 2018 21:58:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-match-with-NOT-condition/m-p/350895#M103869</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-04-19T21:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: eval match with NOT condition</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-match-with-NOT-condition/m-p/350896#M103870</link>
      <description>&lt;P&gt;It seems so simple to just stick a NOT in there.   Thank you for explaining about match! &lt;/P&gt;</description>
      <pubDate>Fri, 20 Apr 2018 11:55:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-match-with-NOT-condition/m-p/350896#M103870</guid>
      <dc:creator>kmaron</dc:creator>
      <dc:date>2018-04-20T11:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: eval match with NOT condition</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-match-with-NOT-condition/m-p/350897#M103871</link>
      <description>&lt;P&gt;When I ran this your way and then with the NOT that @somesoni2 mentioned the NOT came out a tiny bit faster but it's extremely fast in my tiny search anyway so the difference is negligible. Do you know which one would be more efficient? &lt;/P&gt;</description>
      <pubDate>Fri, 20 Apr 2018 11:57:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-match-with-NOT-condition/m-p/350897#M103871</guid>
      <dc:creator>kmaron</dc:creator>
      <dc:date>2018-04-20T11:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: eval match with NOT condition</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-match-with-NOT-condition/m-p/350898#M103872</link>
      <description>&lt;P&gt;@kmaron Use Job Inspector with some significant amount of data to test out the performance.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Apr 2018 12:16:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-match-with-NOT-condition/m-p/350898#M103872</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-04-20T12:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: eval match with NOT condition</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-match-with-NOT-condition/m-p/350899#M103873</link>
      <description>&lt;P&gt;@kmaron, to mark this question as answered, please accept the answer if this has helped.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Apr 2018 12:16:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-match-with-NOT-condition/m-p/350899#M103873</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-04-20T12:16:59Z</dc:date>
    </item>
  </channel>
</rss>

