<?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: Full outer join in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Full-outer-join/m-p/81596#M20696</link>
    <description>&lt;P&gt;I think this is needs improving, but it does produce the results you've described.&lt;/P&gt;

&lt;P&gt;I created a sourcetype of joinq that has 2 sources adata.txt and bdata.txt&lt;/P&gt;

&lt;P&gt;The following search yields the table with 9 rows.&lt;/P&gt;

&lt;P&gt;sourcetype=joinq source="adata.txt" | join threadname [search sourcetype=joinq source!="adata.txt"] | append [search sourcetype=joinq source="adata.txt" | join threadname type=outer [search sourcetype=joinq source!="adata.txt"]] | append [search sourcetype=joinq source!="adata.txt" | join threadname type=outer [search sourcetype=joinq source="adata.txt"]] | table threadname adata bdata | dedup threadname | sort threadname&lt;/P&gt;

&lt;P&gt;Dave&lt;/P&gt;</description>
    <pubDate>Thu, 04 Apr 2013 16:15:44 GMT</pubDate>
    <dc:creator>davebrooking</dc:creator>
    <dc:date>2013-04-04T16:15:44Z</dc:date>
    <item>
      <title>Full outer join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Full-outer-join/m-p/81589#M20689</link>
      <description>&lt;P&gt;How can I meet full outer join requirement in my search??&lt;BR /&gt;
table a and table b with only one filed in two rows are same i want to display all rows from both the tables:&lt;BR /&gt;
like , table a with 5 rows &lt;BR /&gt;
and table b with 6 rows both with a common field thredname&lt;BR /&gt;
and thread name is same in 2 rows. when i am using join type=outer i am getting 6 rows including the details from table a.&lt;BR /&gt;
but my need is like i want 9 table where rows with common Threadname will have fully filled fields and other may have their own data.&lt;BR /&gt;
example&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Table a 
 Threadname  adata     
a1          aaa
a2          aa
a3          aa
ab1         aabb     
ab2         ab     



Table b

Threadname  bdata 
ab1         aabbb
ab2         aabbb
b1          bb
b2          bbb
b3          bbb
b4          bbb

Expected Resultant Table
Threadname  adata     bdata  
a1          aaa
a2          aa
a3          aa
ab1         aabb      aabbb
ab2         ab        aabbb
b1                    bb
b2                    bbb
b3                    bbb
b4                    bbb
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;please help&lt;BR /&gt;
thank you&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2013 05:47:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Full-outer-join/m-p/81589#M20689</guid>
      <dc:creator>smolcj</dc:creator>
      <dc:date>2013-04-02T05:47:04Z</dc:date>
    </item>
    <item>
      <title>Re: Full outer join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Full-outer-join/m-p/81590#M20690</link>
      <description>&lt;P&gt;Hmm, not sure I fully understand, but you might not require a &lt;CODE&gt;join&lt;/CODE&gt;, but that depends on how you get your data...&lt;/P&gt;

&lt;P&gt;If the 'tables' you mention are not tables, but sourcetypes, each row could be seen as an event, with &lt;CODE&gt;adata&lt;/CODE&gt; and &lt;CODE&gt;bdata&lt;/CODE&gt; being fields. Then something like;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | stats first(adata) as adata first(bdata) as bdata by Threadname
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;would be something that could work.&lt;/P&gt;

&lt;P&gt;You should probably give us a few sample events or a better description of your data.&lt;/P&gt;

&lt;P&gt;/K&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2013 13:25:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Full-outer-join/m-p/81590#M20690</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-04-02T13:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: Full outer join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Full-outer-join/m-p/81591#M20691</link>
      <description>&lt;P&gt;Sorry if i confused you. edited the question. kindly please check it !!&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2013 06:34:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Full-outer-join/m-p/81591#M20691</guid>
      <dc:creator>smolcj</dc:creator>
      <dc:date>2013-04-03T06:34:18Z</dc:date>
    </item>
    <item>
      <title>Re: Full outer join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Full-outer-join/m-p/81592#M20692</link>
      <description>&lt;P&gt;Thanks for that, but I was more interested in where the data comes from. Are they csv files, or the output of some splunk reporting command, or in separate events (i.e. table_a in one event, and table_b in another)?&lt;/P&gt;

&lt;P&gt;/k&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:39:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Full-outer-join/m-p/81592#M20692</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2020-09-28T13:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: Full outer join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Full-outer-join/m-p/81593#M20693</link>
      <description>&lt;P&gt;they are the values extracted from log files . Threadname adata and btada are the fields extracted from  2 different log files. table a from file1 and table b from file 2..&lt;BR /&gt;
search may look like&lt;BR /&gt;
index=main sorce=file1 |top Threadname adata | join type=outer Threadname [ search index=main sorce=file2 |top Threadname bdata]&lt;BR /&gt;
but i am not able to obtain full outer join the output looks like&lt;BR /&gt;
     Threadname  adata     bdata&lt;BR /&gt;&lt;BR /&gt;
    a1          aaa&lt;BR /&gt;
    a2          aa&lt;BR /&gt;
    a3          aa&lt;BR /&gt;
    ab1         aabb      aabbb&lt;BR /&gt;
    ab2         ab        aabbb&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2013 08:44:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Full-outer-join/m-p/81593#M20693</guid>
      <dc:creator>smolcj</dc:creator>
      <dc:date>2013-04-03T08:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: Full outer join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Full-outer-join/m-p/81594#M20694</link>
      <description>&lt;P&gt;So.. then you could try:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=main source=file1 OR source=file2 | stats first(adata) as adata first(bdata) as bdata by Threadname&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;assuming that there can be only one (or less) adata per Threadname, and only one (or less) bdata per Threadname.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2013 10:00:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Full-outer-join/m-p/81594#M20694</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-04-03T10:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: Full outer join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Full-outer-join/m-p/81595#M20695</link>
      <description>&lt;P&gt;mmm i have to use a join for this search because i want to extract same field in two different column names so that i can differentiate it as data from different files so i need a join method that can provide full outer join values.. please help  &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2013 12:24:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Full-outer-join/m-p/81595#M20695</guid>
      <dc:creator>smolcj</dc:creator>
      <dc:date>2013-04-04T12:24:51Z</dc:date>
    </item>
    <item>
      <title>Re: Full outer join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Full-outer-join/m-p/81596#M20696</link>
      <description>&lt;P&gt;I think this is needs improving, but it does produce the results you've described.&lt;/P&gt;

&lt;P&gt;I created a sourcetype of joinq that has 2 sources adata.txt and bdata.txt&lt;/P&gt;

&lt;P&gt;The following search yields the table with 9 rows.&lt;/P&gt;

&lt;P&gt;sourcetype=joinq source="adata.txt" | join threadname [search sourcetype=joinq source!="adata.txt"] | append [search sourcetype=joinq source="adata.txt" | join threadname type=outer [search sourcetype=joinq source!="adata.txt"]] | append [search sourcetype=joinq source!="adata.txt" | join threadname type=outer [search sourcetype=joinq source="adata.txt"]] | table threadname adata bdata | dedup threadname | sort threadname&lt;/P&gt;

&lt;P&gt;Dave&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2013 16:15:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Full-outer-join/m-p/81596#M20696</guid>
      <dc:creator>davebrooking</dc:creator>
      <dc:date>2013-04-04T16:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: Full outer join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Full-outer-join/m-p/81597#M20697</link>
      <description>&lt;P&gt;The &lt;CODE&gt;join&lt;/CODE&gt; command's outer join is actually a "left outer" join technically. &lt;/P&gt;

&lt;P&gt;To do what you want,  you should either &lt;/P&gt;

&lt;P&gt;1) don't use join at all,  but use &lt;CODE&gt;append&lt;/CODE&gt; and then &lt;CODE&gt;stats&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=main source=file1 | stats count by Threadname adata | append [ search index=main source=file2 | stats count by Threadname bdata] | stats values(adata) as adata values(bdata) as bdata by Threadname&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;2) better,   do it in a single search pipeline. &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=main (source=file1 OR source=file2) | stats values(adata) as adata values(bdata) as bdata by Threadname&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I understand what you're saying about having to extract fields differently, and do different search language for one side versus the other,  but too often people assume there's no way to do such things in a single pipeline.  I recommend posting the &lt;EM&gt;full&lt;/EM&gt; details of the searches in a separate question, asking whether you can get the desired end result without using join or append. &lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2013 19:41:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Full-outer-join/m-p/81597#M20697</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2013-04-04T19:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: Full outer join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Full-outer-join/m-p/81598#M20698</link>
      <description>&lt;P&gt;This worked for me also! Thank you! &lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2016 16:17:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Full-outer-join/m-p/81598#M20698</guid>
      <dc:creator>jaxjohnny</dc:creator>
      <dc:date>2016-11-11T16:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: Full outer join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Full-outer-join/m-p/81599#M20699</link>
      <description>&lt;P&gt;This worked for me also.  Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2016 18:29:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Full-outer-join/m-p/81599#M20699</guid>
      <dc:creator>jaxjohnny</dc:creator>
      <dc:date>2016-11-11T18:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: Full outer join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Full-outer-join/m-p/81600#M20700</link>
      <description>&lt;P&gt;This worked for me .  Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2016 18:30:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Full-outer-join/m-p/81600#M20700</guid>
      <dc:creator>jaxjohnny</dc:creator>
      <dc:date>2016-11-11T18:30:17Z</dc:date>
    </item>
    <item>
      <title>Re: Full outer join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Full-outer-join/m-p/81601#M20701</link>
      <description>&lt;P&gt;Worked like a charm&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2017 23:18:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Full-outer-join/m-p/81601#M20701</guid>
      <dc:creator>mad4wknds</dc:creator>
      <dc:date>2017-05-31T23:18:49Z</dc:date>
    </item>
    <item>
      <title>Re: Full outer join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Full-outer-join/m-p/81602#M20702</link>
      <description>&lt;P&gt;Why are people complacent about outer &lt;CODE&gt;join&lt;/CODE&gt; functionality? Shouldn't we be questioning the SPL development skills here? Why do they even provide you with the outer option, if it's just going to be a left outer join? I would logically assume that the word "outer" means "full outer" here, especially considering I know there is already a command for an outer left join...&lt;/P&gt;

&lt;P&gt;I understand why &lt;CODE&gt;stats&lt;/CODE&gt; is better than &lt;CODE&gt;join&lt;/CODE&gt; but why even offer the outer option with &lt;CODE&gt;join&lt;/CODE&gt;...?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2020 22:37:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Full-outer-join/m-p/81602#M20702</guid>
      <dc:creator>nick405060</dc:creator>
      <dc:date>2020-02-13T22:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: Full outer join</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Full-outer-join/m-p/81603#M20703</link>
      <description>&lt;P&gt;Also, some people looking at this solution &lt;EM&gt;may&lt;/EM&gt; want to be using &lt;CODE&gt;stats list&lt;/CODE&gt; not &lt;CODE&gt;stats values&lt;/CODE&gt; here, depending on your outer join use case&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2020 22:01:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Full-outer-join/m-p/81603#M20703</guid>
      <dc:creator>nick405060</dc:creator>
      <dc:date>2020-02-14T22:01:28Z</dc:date>
    </item>
  </channel>
</rss>

