<?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: Splunk Query in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-write-a-search-to-implement-NOT-IN-functionality-in-SQL/m-p/625029#M14878</link>
    <description>&lt;P&gt;IN-PROGRESS events are random and can have duplicate events name, they don't follow any kind of order as such.&lt;BR /&gt;&lt;BR /&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Thu, 22 Dec 2022 02:28:54 GMT</pubDate>
    <dc:creator>ShubhamWanne</dc:creator>
    <dc:date>2022-12-22T02:28:54Z</dc:date>
    <item>
      <title>How to write a search to implement NOT IN functionality in SQL along with eval?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-write-a-search-to-implement-NOT-IN-functionality-in-SQL/m-p/624983#M14870</link>
      <description>&lt;P&gt;I am new to splunk and working on a complex query where;&lt;BR /&gt;I am supposed to implement NOT IN functionality in SQL along with eval&lt;BR /&gt;&lt;BR /&gt;I want to skip all the IN-PROGRESS events who later went into COMPLETED state, and display all the events which are still in IN-PROGRESS state.&lt;/P&gt;
&lt;P&gt;For example&lt;BR /&gt;COMPLETED events:&lt;/P&gt;
&lt;P&gt;event1&lt;BR /&gt;event5&lt;BR /&gt;event4&lt;BR /&gt;event7&lt;BR /&gt;&lt;BR /&gt;IN-PROGRESS events:&lt;/P&gt;
&lt;P&gt;event3&lt;BR /&gt;event1&lt;BR /&gt;event4&lt;BR /&gt;&lt;BR /&gt;Expected result&lt;BR /&gt;&lt;STRONG&gt;event3&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Given below are the queries to fetch COMPLETED and IN-PROGRESS events:&lt;BR /&gt;&lt;BR /&gt;index=abc message="*COMPLETED*" | eval splitStr=split(message, ",") | eval eventName=mvindex(splitStr,1) | table eventName&lt;BR /&gt;index=abc message="*IN-PROGRESS*" | eval splitStr=split(message, ",") | eval eventName=mvindex(splitStr,1) | table eventName&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thank you in advance.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2022 15:02:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-write-a-search-to-implement-NOT-IN-functionality-in-SQL/m-p/624983#M14870</guid>
      <dc:creator>ShubhamWanne</dc:creator>
      <dc:date>2022-12-21T15:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Query</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-write-a-search-to-implement-NOT-IN-functionality-in-SQL/m-p/624990#M14872</link>
      <description>&lt;P&gt;Collect all IN-PROGRESS and COMPLETED events.&amp;nbsp; Keep only the most recent event for each unique identifier.&amp;nbsp; Discard the COMPLETED events and what is left will be those IN-PROGRESS and not COMPLETED.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=abc (message="*IN-PROGRESS*" OR message="*COMPLETED*") 
| eval splitStr=split(message, ",") 
| eval eventName=mvindex(splitStr,1) 
| dedup eventName
| where NOT match(message, "COMPLETED")
| table eventName&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 21 Dec 2022 14:30:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-write-a-search-to-implement-NOT-IN-functionality-in-SQL/m-p/624990#M14872</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-12-21T14:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Query</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-write-a-search-to-implement-NOT-IN-functionality-in-SQL/m-p/625005#M14875</link>
      <description>&lt;P&gt;I appreciate the quick reponse&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;but this query fails in scenario where:&lt;BR /&gt;COMPLETED (C)&lt;BR /&gt;Event1, Event2, Event3 and&lt;BR /&gt;&lt;BR /&gt;IN-PROGRESS (I-P)&lt;BR /&gt;Event1, Event2, Event2, Event2&lt;BR /&gt;&lt;BR /&gt;Then&lt;/P&gt;&lt;PRE&gt;index=abc (message="*IN-PROGRESS*" OR message="*COMPLETED*") 
| eval splitStr=split(message, ",") 
| eval eventName=mvindex(splitStr,1) &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;This query will list&lt;BR /&gt;Event1(C), Event1(I-P),&amp;nbsp;Event2(I-P),Event2(I-P),Event2(I-P),Event2(C),Event3(C)&lt;BR /&gt;&lt;BR /&gt;and&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;| dedup eventName&lt;/PRE&gt;&lt;P&gt;will return&lt;BR /&gt;&amp;nbsp;Event1(C),&amp;nbsp;Event2(I-P),Event3(C)&lt;BR /&gt;&lt;BR /&gt;and&lt;/P&gt;&lt;PRE&gt;| where NOT match(message, "COMPLETED")&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;will return&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Event2&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Ideally, result should be 0.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Thank you.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2022 15:58:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-write-a-search-to-implement-NOT-IN-functionality-in-SQL/m-p/625005#M14875</guid>
      <dc:creator>ShubhamWanne</dc:creator>
      <dc:date>2022-12-21T15:58:16Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Query</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-write-a-search-to-implement-NOT-IN-functionality-in-SQL/m-p/625017#M14876</link>
      <description>&lt;P&gt;My query assumes events are in reverse time order, which is the default.&amp;nbsp; If that is not the case for your data then please advise so I can revise the query.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2022 20:12:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-write-a-search-to-implement-NOT-IN-functionality-in-SQL/m-p/625017#M14876</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-12-21T20:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Query</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-write-a-search-to-implement-NOT-IN-functionality-in-SQL/m-p/625029#M14878</link>
      <description>&lt;P&gt;IN-PROGRESS events are random and can have duplicate events name, they don't follow any kind of order as such.&lt;BR /&gt;&lt;BR /&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2022 02:28:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-write-a-search-to-implement-NOT-IN-functionality-in-SQL/m-p/625029#M14878</guid>
      <dc:creator>ShubhamWanne</dc:creator>
      <dc:date>2022-12-22T02:28:54Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Query</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-write-a-search-to-implement-NOT-IN-functionality-in-SQL/m-p/625098#M14883</link>
      <description>&lt;P&gt;If IN-PROGRESS arrives after COMPLETE then I would think the event is now in progress.&amp;nbsp; OTOH, if the logic is if COMPLETE is seen at any time then IN_PROGRESS must be ignored then try this query.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=abc (message="*IN-PROGRESS*" OR message="*COMPLETED*") 
| eval splitStr=split(message, ",") 
| eval eventName=mvindex(splitStr,1) 
| stats values(message) as messages by eventName
| where isnull(mvfind(messages, "COMPLETED"))
| table eventName&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 22 Dec 2022 14:41:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-write-a-search-to-implement-NOT-IN-functionality-in-SQL/m-p/625098#M14883</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-12-22T14:41:49Z</dc:date>
    </item>
  </channel>
</rss>

