<?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 Exclusive Right Join option in splunk in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Exclusive-Right-Join-option-in-splunk/m-p/342068#M101359</link>
    <description>&lt;P&gt;I am trying to list the events from the subsearch which are not found in the main search.&lt;/P&gt;

&lt;P&gt;For example the subsearch returns the table with the following records:&lt;/P&gt;

&lt;P&gt;B&lt;BR /&gt;
C&lt;BR /&gt;
D&lt;/P&gt;

&lt;P&gt;And the main search returns the following records:&lt;/P&gt;

&lt;P&gt;A&lt;BR /&gt;
B&lt;BR /&gt;
C&lt;/P&gt;

&lt;P&gt;So the final result will be "D"&lt;/P&gt;

&lt;P&gt;There is an "Exclusive Right Join" concept in SQL.&lt;/P&gt;

&lt;P&gt;Can i achieve something similar in Splunk? I have looked at the "join" command documentation but it does not support this specific type.&lt;/P&gt;</description>
    <pubDate>Thu, 02 Nov 2017 15:51:33 GMT</pubDate>
    <dc:creator>kiril123</dc:creator>
    <dc:date>2017-11-02T15:51:33Z</dc:date>
    <item>
      <title>Exclusive Right Join option in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exclusive-Right-Join-option-in-splunk/m-p/342068#M101359</link>
      <description>&lt;P&gt;I am trying to list the events from the subsearch which are not found in the main search.&lt;/P&gt;

&lt;P&gt;For example the subsearch returns the table with the following records:&lt;/P&gt;

&lt;P&gt;B&lt;BR /&gt;
C&lt;BR /&gt;
D&lt;/P&gt;

&lt;P&gt;And the main search returns the following records:&lt;/P&gt;

&lt;P&gt;A&lt;BR /&gt;
B&lt;BR /&gt;
C&lt;/P&gt;

&lt;P&gt;So the final result will be "D"&lt;/P&gt;

&lt;P&gt;There is an "Exclusive Right Join" concept in SQL.&lt;/P&gt;

&lt;P&gt;Can i achieve something similar in Splunk? I have looked at the "join" command documentation but it does not support this specific type.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2017 15:51:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exclusive-Right-Join-option-in-splunk/m-p/342068#M101359</guid>
      <dc:creator>kiril123</dc:creator>
      <dc:date>2017-11-02T15:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: Exclusive Right Join option in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exclusive-Right-Join-option-in-splunk/m-p/342069#M101360</link>
      <description>&lt;P&gt;Hi &lt;BR /&gt;
Can you share your Sample main search and sub-search ( remove/ fake confidential value in search  ) ?? So we can help you. &lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2017 16:03:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exclusive-Right-Join-option-in-splunk/m-p/342069#M101360</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2017-11-02T16:03:57Z</dc:date>
    </item>
    <item>
      <title>Re: Exclusive Right Join option in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exclusive-Right-Join-option-in-splunk/m-p/342070#M101361</link>
      <description>&lt;P&gt;There are several ways of going about what you're requesting. I'll suggest one, and if it doesn't work for you, maybe you can provide more details about your specific use case, and I'll try again.&lt;/P&gt;

&lt;P&gt;Let's say you have a main search and a subsearch that both return events containing the field &lt;CODE&gt;unique_id&lt;/CODE&gt;, and the value of the &lt;CODE&gt;unique_id&lt;/CODE&gt; field matches your map above (results from the subsearch include &lt;CODE&gt;unique_id=B&lt;/CODE&gt;, &lt;CODE&gt;unique_id=C&lt;/CODE&gt;, and &lt;CODE&gt;unique_id=D&lt;/CODE&gt;; results from the main search include &lt;CODE&gt;unique_id=A&lt;/CODE&gt;, &lt;CODE&gt;unique_id=B&lt;/CODE&gt;, &lt;CODE&gt;unique_id=C&lt;/CODE&gt;). So your goal would be to retain the event with &lt;CODE&gt;unique_id=D&lt;/CODE&gt;. Then I'd structure the approach like this:&lt;BR /&gt;
&lt;CODE&gt;base search | eval found_in_base_search=1 | append [ subsearch | eval found_in_sub_search=1 ] | eventstats values(found_in_base_search) AS found_in_base_search BY unique_id | where isnull(found_in_base_search) AND isnotnull(found_in_sub_search)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;The &lt;CODE&gt;eventstats&lt;/CODE&gt; portion of the search will apply the field &lt;CODE&gt;found_in_base_search&lt;/CODE&gt; across all events sharing the same &lt;CODE&gt;unique_id&lt;/CODE&gt;, so then we just filter down to events that contain the field &lt;CODE&gt;found_in_sub_search&lt;/CODE&gt; but do not contain the field &lt;CODE&gt;found_in_base_search&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2017 17:23:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exclusive-Right-Join-option-in-splunk/m-p/342070#M101361</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2017-11-02T17:23:52Z</dc:date>
    </item>
    <item>
      <title>Re: Exclusive Right Join option in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exclusive-Right-Join-option-in-splunk/m-p/342071#M101362</link>
      <description>&lt;P&gt;Did this work for you, @kiril123?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2017 20:39:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exclusive-Right-Join-option-in-splunk/m-p/342071#M101362</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2017-11-07T20:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: Exclusive Right Join option in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exclusive-Right-Join-option-in-splunk/m-p/342072#M101363</link>
      <description>&lt;P&gt;No, this doesn't work for me. To test this for both main search and sub-search I selected the same interval: "earliest=-15m@m latest=-5m@m". So in theory no events should be returned as time periods fully overlap. However this is not the case.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2017 20:57:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exclusive-Right-Join-option-in-splunk/m-p/342072#M101363</guid>
      <dc:creator>kiril123</dc:creator>
      <dc:date>2017-11-08T20:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: Exclusive Right Join option in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Exclusive-Right-Join-option-in-splunk/m-p/342073#M101364</link>
      <description>&lt;P&gt;Hmm...those events that were returned - did they have values for &lt;CODE&gt;found_in_base_search&lt;/CODE&gt; and/or &lt;CODE&gt;found_in_sub_search&lt;/CODE&gt;? If I know where it's going wrong, I can help troubleshoot.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2017 03:54:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Exclusive-Right-Join-option-in-splunk/m-p/342073#M101364</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2017-11-09T03:54:10Z</dc:date>
    </item>
  </channel>
</rss>

