<?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 Help with search with multiple NOT IN subqueries in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-with-search-with-multiple-NOT-IN-subqueries/m-p/617821#M214703</link>
    <description>&lt;PRE&gt;The goal is to take all eventIds with "operation failed" and exclude events with "Duplicate key" and "Event processed successfully":

index="idx" "Transaction failed" 
| table eventId
| dedup eventId
| search NOT [search index="idx" "Duplicate key"
             | table eventId ]
| search NOT [search index="idx" "Event processed successfully"
             | table eventId ] 

But for some reason the last NOT subquery doesn't exclude the events which processed successfully:
| search NOT [search index="idx" "Event processed successfully"
             | table eventId ] &lt;/PRE&gt;</description>
    <pubDate>Thu, 20 Oct 2022 14:50:07 GMT</pubDate>
    <dc:creator>usarios</dc:creator>
    <dc:date>2022-10-20T14:50:07Z</dc:date>
    <item>
      <title>Help with search with multiple NOT IN subqueries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-search-with-multiple-NOT-IN-subqueries/m-p/617821#M214703</link>
      <description>&lt;PRE&gt;The goal is to take all eventIds with "operation failed" and exclude events with "Duplicate key" and "Event processed successfully":

index="idx" "Transaction failed" 
| table eventId
| dedup eventId
| search NOT [search index="idx" "Duplicate key"
             | table eventId ]
| search NOT [search index="idx" "Event processed successfully"
             | table eventId ] 

But for some reason the last NOT subquery doesn't exclude the events which processed successfully:
| search NOT [search index="idx" "Event processed successfully"
             | table eventId ] &lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Oct 2022 14:50:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-search-with-multiple-NOT-IN-subqueries/m-p/617821#M214703</guid>
      <dc:creator>usarios</dc:creator>
      <dc:date>2022-10-20T14:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: Query with multiple NOT IN subqueries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-search-with-multiple-NOT-IN-subqueries/m-p/617832#M214713</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/246746"&gt;@usarios&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;let me inderstand there could be eventId with only one message or the same eventId could have different messages in different events?&lt;/P&gt;&lt;P&gt;if the second you could run something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="idx" ("Transaction failed" OR "Duplicate key" OR "Event processed successfully")
| eval message=case(searchmatch("Transaction failed"),"Transaction failed", searchmatch("Duplicate key"),"Duplicate key",searchmatch("Event processed successfully","Event processed successfully")
| stats dc(message) AS message_count values(message) AS message BY eventId
| where message_count=1 AND message="Transaction failed"
| table eventId&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2022 12:43:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-search-with-multiple-NOT-IN-subqueries/m-p/617832#M214713</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-10-20T12:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: Query with multiple NOT IN subqueries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-search-with-multiple-NOT-IN-subqueries/m-p/617851#M214726</link>
      <description>&lt;P&gt;Grazie,&amp;nbsp;&lt;SPAN&gt;Giuseppe.&lt;BR /&gt;&lt;BR /&gt;Yes, that works for me!&lt;BR /&gt;&lt;BR /&gt;Ciao&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2022 14:10:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-search-with-multiple-NOT-IN-subqueries/m-p/617851#M214726</guid>
      <dc:creator>usarios</dc:creator>
      <dc:date>2022-10-20T14:10:09Z</dc:date>
    </item>
  </channel>
</rss>

