<?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: How to use Not Exists function in Splunk when 2 indexes are involved ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-Not-Exists-function-in-Splunk-when-2-indexes-are/m-p/674274#M230807</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;gcusello&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is working fine when we have a single field in common.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If we have more than 1 field as a key between the 2 searches , then is it possible to Exclude&amp;nbsp;results from search 2 based on the 2 fields instead of 1 ??&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 15 Jan 2024 13:35:05 GMT</pubDate>
    <dc:creator>Real_captain</dc:creator>
    <dc:date>2024-01-15T13:35:05Z</dc:date>
    <item>
      <title>How to use Not Exists function in Splunk when 2 indexes are involved ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-Not-Exists-function-in-Splunk-when-2-indexes-are/m-p/674231#M230787</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone help to explain how we can use Not-exists in Splunk.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example is attached below for which i need to use this&amp;nbsp; function in Splunk.&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) Search1 generates a set of results.&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) Search2 also generated a set of results.&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is a common field between the 2 Searches. I want to add a search in splunk as below :&amp;nbsp;&lt;/P&gt;&lt;P&gt;Results of &lt;STRONG&gt;Search1&lt;/STRONG&gt;&amp;nbsp;(Not exists (results of &lt;STRONG&gt;Search2&lt;/STRONG&gt; )) common field = &lt;STRONG&gt;Field1&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Search1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;`eoc_stp_events_indexes` host=p* OR host=azure_srt_prd_0001&amp;nbsp;&amp;nbsp;&lt;BR /&gt;| table timestampOfReception, messageOriginIdentifier, messageType, status, &lt;STRONG&gt;messageBusinessIdentifier&lt;/STRONG&gt;, originPlatform, direction, sourcePlatform, currentPlatform, targetPlatform, senderIdentifier, receiverIdentifier, currentPlatform&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Search2 :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;(index=events_prod_srt_shareholders_esa OR index=eoc_srt) seev.047 Name="Created Disclosure Response Status Advice Accepted"&lt;BR /&gt;| table&amp;nbsp; &lt;STRONG&gt;messageBusinessIdentifier&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Field1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;messageBusinessIdentifier&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jan 2024 08:45:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-Not-Exists-function-in-Splunk-when-2-indexes-are/m-p/674231#M230787</guid>
      <dc:creator>Real_captain</dc:creator>
      <dc:date>2024-01-15T08:45:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Not Exists function in Splunk when 2 indexes are involved ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-Not-Exists-function-in-Splunk-when-2-indexes-are/m-p/674234#M230789</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;here is explained how to emulate joins in &amp;nbsp;SQL in SPL.&amp;nbsp;&lt;A href="https://community.splunk.com/t5/Splunk-Search/What-is-the-relation-between-the-Splunk-inner-left-join-and-the/m-p/391290/highlight/true#M113950" target="_blank"&gt;https://community.splunk.com/t5/Splunk-Search/What-is-the-relation-between-the-Splunk-inner-left-join-and-the/m-p/391290/highlight/true#M113950&lt;/A&gt;&lt;/P&gt;&lt;P&gt;There is also several conf presentations how to join datasets without command join e.g.&amp;nbsp;&lt;A href="https://conf.splunk.com/files/2019/slides/FNC2751.pdf" target="_blank"&gt;https://conf.splunk.com/files/2019/slides/FNC2751.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;r. Ismo&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jan 2024 08:52:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-Not-Exists-function-in-Splunk-when-2-indexes-are/m-p/674234#M230789</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2024-01-15T08:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Not Exists function in Splunk when 2 indexes are involved ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-Not-Exists-function-in-Splunk-when-2-indexes-are/m-p/674236#M230790</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/263966"&gt;@Real_captain&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Please try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;`eoc_stp_events_indexes` host=p* OR host=azure_srt_prd_0001  [ search (index=events_prod_srt_shareholders_esa OR index=eoc_srt) seev.047 Name="Created Disclosure Response Status Advice Accepted"
| fields messageBusinessIdentifier ]
| table timestampOfReception, messageOriginIdentifier, messageType, status, messageBusinessIdentifier, originPlatform, direction, sourcePlatform, currentPlatform, targetPlatform, senderIdentifier, receiverIdentifier, currentPlatform&lt;/LI-CODE&gt;&lt;P&gt;in few words: you have to use a subsearch putting attention that the fields at the end of the subsearch are only the ones you want to use as key and that the field names are exactly the same.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jan 2024 09:09:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-Not-Exists-function-in-Splunk-when-2-indexes-are/m-p/674236#M230790</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-01-15T09:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Not Exists function in Splunk when 2 indexes are involved ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-Not-Exists-function-in-Splunk-when-2-indexes-are/m-p/674240#M230791</link>
      <description>&lt;P&gt;There are several possible approaches to this problem.&lt;/P&gt;&lt;P&gt;One is to use a subsearch. &lt;A href="https://docs.splunk.com/Documentation/Splunk/9.1.2/SearchTutorial/Useasubsearch" target="_blank" rel="noopener"&gt;https://docs.splunk.com/Documentation/Splunk/9.1.2/SearchTutorial/Useasubsearch&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Long story short - if you have search1 returning a list of values for field1, you use&lt;/P&gt;&lt;PRE&gt;NOT ([your search | returining| values | table field1])&lt;/PRE&gt;&lt;P&gt;as part of your main search.&lt;/P&gt;&lt;P&gt;This however has its drawbacks - the typical limits of a subsearch - the number of returned results and the execution time limit. That means that your search can be silently finalized without you even realizing that you're getting incomplete/invalid results.&lt;/P&gt;&lt;P&gt;Another approach would be to append both of those resultsets adding a field which describes which search they come from and then do stats over the common field and filter out those that do have the identifier.&lt;/P&gt;&lt;P&gt;Like&lt;/P&gt;&lt;PRE&gt;&amp;lt;search1&amp;gt; | eval wherefrom=1 | append &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ &amp;lt;search2&amp;gt; | eval wherefrom=2 ]&lt;BR /&gt;| stats values(*) as * by common_field&lt;BR /&gt;| where NOT wherefrom=2&lt;/PRE&gt;&lt;P&gt;Append though is also subject to subsearch limitations&lt;/P&gt;&lt;P&gt;&amp;nbsp;If both your searches are streaming searches, you can use multisearch instead of appending results - multisearch is _not_ subject to subsearch limitations.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jan 2024 09:18:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-Not-Exists-function-in-Splunk-when-2-indexes-are/m-p/674240#M230791</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-01-15T09:18:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Not Exists function in Splunk when 2 indexes are involved ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-Not-Exists-function-in-Splunk-when-2-indexes-are/m-p/674246#M230795</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to extract only those events of Search1 for which there does not exists the result in Search2.&amp;nbsp;&lt;/P&gt;&lt;P&gt;is it possible in SPLUNK ??&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Similar to NOT EXISTS in DB2.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jan 2024 10:10:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-Not-Exists-function-in-Splunk-when-2-indexes-are/m-p/674246#M230795</guid>
      <dc:creator>Real_captain</dc:creator>
      <dc:date>2024-01-15T10:10:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Not Exists function in Splunk when 2 indexes are involved ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-Not-Exists-function-in-Splunk-when-2-indexes-are/m-p/674254#M230797</link>
      <description>&lt;P class="lia-align-left"&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-left"&gt;Can we use below to fetch only those events which are extracted by Search1 and not extracted by Search2 based on the field&amp;nbsp;messageBusinessIdentifier.&lt;/P&gt;&lt;P class="lia-align-left"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-left"&gt;`eoc_stp_events_indexes` host=p* OR host=azure_srt_prd_0001&amp;nbsp;&amp;nbsp;&lt;BR /&gt;NOT [ search (index=events_prod_srt_shareholders_esa OR index=eoc_srt) seev.047 Name="Created Disclosure Response Status Advice Accepted"&lt;BR /&gt;| fields messageBusinessIdentifier ]&lt;BR /&gt;| fillnull timestampOfReception , messageOriginIdentifier, messageBusinessIdentifier, direction, messageType, currentPlatform, sAAUserReference value="-"&lt;BR /&gt;| sort timestampOfReception&lt;BR /&gt;| table timestampOfReception, messageOriginIdentifier, messageType, status, messageBusinessIdentifier, originPlatform, direction, sourcePlatform, currentPlatform, targetPlatform, senderIdentifier, receiverIdentifier, currentPlatform,&lt;BR /&gt;| rename timestampOfReception AS "Timestamp of reception", originPlatform AS "Origin platform", sourcePlatform AS "Source platform", targetPlatform AS "Target platform", senderIdentifier AS "Sender identifier", receiverIdentifier AS "Receiver identifier",&lt;BR /&gt;messageOriginIdentifier AS "Origin identifier", messageBusinessIdentifier AS "Business identifier", direction AS Direction, currentPlatform AS "Current platform", sAAUserReference AS "SAA user reference", messageType AS "Message type"&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jan 2024 10:25:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-Not-Exists-function-in-Splunk-when-2-indexes-are/m-p/674254#M230797</guid>
      <dc:creator>Real_captain</dc:creator>
      <dc:date>2024-01-15T10:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Not Exists function in Splunk when 2 indexes are involved ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-Not-Exists-function-in-Splunk-when-2-indexes-are/m-p/674260#M230799</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/263966"&gt;@Real_captain&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;sorry, if you want to exclude results from search 2 you have to use the NOT operator:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;`eoc_stp_events_indexes` host=p* OR host=azure_srt_prd_0001 NOT [ search (index=events_prod_srt_shareholders_esa OR index=eoc_srt) seev.047 Name="Created Disclosure Response Status Advice Accepted"
| fields messageBusinessIdentifier ]
| table timestampOfReception, messageOriginIdentifier, messageType, status, messageBusinessIdentifier, originPlatform, direction, sourcePlatform, currentPlatform, targetPlatform, senderIdentifier, receiverIdentifier, currentPlatform&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jan 2024 11:04:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-Not-Exists-function-in-Splunk-when-2-indexes-are/m-p/674260#M230799</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-01-15T11:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Not Exists function in Splunk when 2 indexes are involved ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-Not-Exists-function-in-Splunk-when-2-indexes-are/m-p/674274#M230807</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;gcusello&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is working fine when we have a single field in common.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If we have more than 1 field as a key between the 2 searches , then is it possible to Exclude&amp;nbsp;results from search 2 based on the 2 fields instead of 1 ??&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jan 2024 13:35:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-Not-Exists-function-in-Splunk-when-2-indexes-are/m-p/674274#M230807</guid>
      <dc:creator>Real_captain</dc:creator>
      <dc:date>2024-01-15T13:35:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Not Exists function in Splunk when 2 indexes are involved ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-Not-Exists-function-in-Splunk-when-2-indexes-are/m-p/674279#M230809</link>
      <description>&lt;P&gt;You can return more than one field from the subsearch.&lt;/P&gt;&lt;P&gt;If you have a subsearch returning a set of values&lt;/P&gt;&lt;PRE&gt;field1=val1 field2=val2 field3=val3&lt;BR /&gt;field1=val4 field2=val5 field3=val6&lt;BR /&gt;field1=val7 field2=val8 field3=val9&lt;BR /&gt;...&lt;/PRE&gt;&lt;P&gt;It is rendered as sets of condition in the outer search&lt;/P&gt;&lt;PRE&gt;(field1=val1 AND field2=val2 AND field3=val3) OR (field1=val4 AND field2=val5 AND field3=val6) OR (field1=val7 ANR field2=val8 AND field3=val9) ...&lt;/PRE&gt;&lt;P&gt;So you can filter by any set of fields.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jan 2024 14:24:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-Not-Exists-function-in-Splunk-when-2-indexes-are/m-p/674279#M230809</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-01-15T14:24:33Z</dc:date>
    </item>
  </channel>
</rss>

