<?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: Outter Join in Splunk in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Outer-Join-in-Splunk/m-p/543058#M153834</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/232282"&gt;@afurze&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Splunk isn't a db!&lt;/P&gt;&lt;P&gt;it has the join command but it's better to avoid it because it's very slow!&lt;/P&gt;&lt;P&gt;You could have two approaches:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;if you haven't many events from the second host (less than 50,000) you can use the subsearch;&lt;/LI&gt;&lt;LI&gt;if you have many events (more than 50,000) you have to use stats.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;so if you have events in different indexes (index_A or index_B)&lt;/P&gt;&lt;P&gt;in the first case:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=index_A NOT [ search index=index_B | dedup host | fields host]
| ...&lt;/LI-CODE&gt;&lt;P&gt;In the second case:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=index_ OR index=index_B
| stats dc(index) AS dc_index values(index) AS index BY host
| where dc_index=1 AND index=index_A&lt;/LI-CODE&gt;&lt;P&gt;If you have your data all in the same index, you have to separate events using the sourcetype or another field.&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>Tue, 09 Mar 2021 16:08:00 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2021-03-09T16:08:00Z</dc:date>
    <item>
      <title>Outer Join in Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Outer-Join-in-Splunk/m-p/543057#M153833</link>
      <description>&lt;P&gt;All,&lt;/P&gt;&lt;P&gt;I've been trying to find a solution for this for a few days.&amp;nbsp; We have multiple tools sending data in on their coverage and we would like to have a search that will show hosts which exist in one but not the other, in SQL terms, an OUTER JOIN.&lt;/P&gt;&lt;P&gt;I have found that Splunk doesn't support a true outer join, so I'm still searching for a solution.&lt;/P&gt;&lt;P&gt;Edit: spelling&lt;/P&gt;</description>
      <pubDate>Tue, 09 Mar 2021 16:00:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Outer-Join-in-Splunk/m-p/543057#M153833</guid>
      <dc:creator>afurze</dc:creator>
      <dc:date>2021-03-09T16:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: Outter Join in Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Outer-Join-in-Splunk/m-p/543058#M153834</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/232282"&gt;@afurze&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Splunk isn't a db!&lt;/P&gt;&lt;P&gt;it has the join command but it's better to avoid it because it's very slow!&lt;/P&gt;&lt;P&gt;You could have two approaches:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;if you haven't many events from the second host (less than 50,000) you can use the subsearch;&lt;/LI&gt;&lt;LI&gt;if you have many events (more than 50,000) you have to use stats.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;so if you have events in different indexes (index_A or index_B)&lt;/P&gt;&lt;P&gt;in the first case:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=index_A NOT [ search index=index_B | dedup host | fields host]
| ...&lt;/LI-CODE&gt;&lt;P&gt;In the second case:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=index_ OR index=index_B
| stats dc(index) AS dc_index values(index) AS index BY host
| where dc_index=1 AND index=index_A&lt;/LI-CODE&gt;&lt;P&gt;If you have your data all in the same index, you have to separate events using the sourcetype or another field.&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>Tue, 09 Mar 2021 16:08:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Outer-Join-in-Splunk/m-p/543058#M153834</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-03-09T16:08:00Z</dc:date>
    </item>
    <item>
      <title>Re: Outter Join in Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Outer-Join-in-Splunk/m-p/543061#M153835</link>
      <description>&lt;P&gt;This is exactly what I need, thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 09 Mar 2021 16:26:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Outer-Join-in-Splunk/m-p/543061#M153835</guid>
      <dc:creator>afurze</dc:creator>
      <dc:date>2021-03-09T16:26:34Z</dc:date>
    </item>
  </channel>
</rss>

