<?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: Outer join not working in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Outer-join-not-working/m-p/567546#M197798</link>
    <description>&lt;P&gt;Perhaps I got the fields confused.&amp;nbsp; The field in the &lt;FONT face="courier new,courier"&gt;by&lt;/FONT&gt; clause of the &lt;FONT face="courier new,courier"&gt;stats&lt;/FONT&gt; command must be one that contains a value shared by events in both indexes.&lt;/P&gt;</description>
    <pubDate>Sun, 19 Sep 2021 14:19:35 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2021-09-19T14:19:35Z</dc:date>
    <item>
      <title>Outer join not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Outer-join-not-working/m-p/567536#M197792</link>
      <description>&lt;P&gt;It seem that outer join is not working for me and I have no idea why.&lt;BR /&gt;I have this two events:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;Event 1 (index="faults"):&lt;BR /&gt;&amp;nbsp;Id = &lt;A href="http://127.0.0.1:8000/en-US/app/proton_logs/search?q=search%20index%3D%22faults%22%20SN%3D0090%20Id%3Da8015353-18bf-11ec-8b0a-7c2a311251af%0A%7Cjoin%20type%3Douter%20id%20%5Bsearch%20index%3D%22axes%22%5D%0A%7Ctable%20*&amp;amp;display.page.search.mode=verbose&amp;amp;dispatch.sample_ratio=1&amp;amp;workload_pool=&amp;amp;earliest=-30d%40d&amp;amp;latest=now&amp;amp;display.page.search.tab=events&amp;amp;display.general.type=statistics&amp;amp;sid=1632043374.163#" target="_blank" rel="noopener"&gt;a8015353-18bf-11ec-8b0a-7c2a311251af&lt;/A&gt;&lt;BR /&gt;AxesId = &lt;A href="http://127.0.0.1:8000/en-US/app/proton_logs/search?q=search%20index%3D%22faults%22%20SN%3D0090%20Id%3Da8015353-18bf-11ec-8b0a-7c2a311251af%0A%7Cjoin%20type%3Douter%20id%20%5Bsearch%20index%3D%22axes%22%5D%0A%7Ctable%20*&amp;amp;display.page.search.mode=verbose&amp;amp;dispatch.sample_ratio=1&amp;amp;workload_pool=&amp;amp;earliest=-30d%40d&amp;amp;latest=now&amp;amp;display.page.search.tab=events&amp;amp;display.general.type=statistics&amp;amp;sid=1632043374.163#" target="_blank" rel="noopener"&gt;a7ba0fd6-18bf-11ec-b369-7c2a311251af&lt;/A&gt;&lt;BR /&gt;TR = 3&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;Event 2 (index="axes"):&lt;BR /&gt;id = &lt;A href="http://127.0.0.1:8000/en-US/app/proton_logs/search?s=%2FservicesNS%2Ffvarela%2Fproton_logs%2Fsaved%2Fsearches%2FVersions%2520from%2520Combined&amp;amp;display.page.search.mode=verbose&amp;amp;dispatch.sample_ratio=1&amp;amp;workload_pool=&amp;amp;q=search%20index%3D%22axes%22%20id%3D%22a8015354-18bf-11ec-b3bb-7c2a311251af%22&amp;amp;earliest=0&amp;amp;latest=&amp;amp;display.page.search.tab=events&amp;amp;display.general.type=events&amp;amp;sid=1632042068.153#" target="_blank" rel="noopener"&gt;a8015354-18bf-11ec-b3bb-7c2a311251af&lt;/A&gt;&lt;BR /&gt;parent_id = &lt;A href="http://127.0.0.1:8000/en-US/app/proton_logs/search?s=%2FservicesNS%2Ffvarela%2Fproton_logs%2Fsaved%2Fsearches%2FVersions%2520from%2520Combined&amp;amp;display.page.search.mode=verbose&amp;amp;dispatch.sample_ratio=1&amp;amp;workload_pool=&amp;amp;q=search%20index%3D%22axes%22%20id%3D%22a8015354-18bf-11ec-b3bb-7c2a311251af%22&amp;amp;earliest=0&amp;amp;latest=&amp;amp;display.page.search.tab=events&amp;amp;display.general.type=events&amp;amp;sid=1632042068.153#" target="_blank" rel="noopener"&gt;a8015353-18bf-11ec-8b0a-7c2a311251af&lt;/A&gt;&lt;BR /&gt;table= 10&lt;BR /&gt;couch= 30&lt;/P&gt;&lt;P&gt;My main search retrieves Event 1.&lt;BR /&gt;I want to use an outer join to retrieve 'table' and 'couch' from Event2. I have two choices to join the events. I have tried both, didn't work:&lt;BR /&gt;&lt;BR /&gt;Event1 AxesId is Event2 id&lt;BR /&gt;Event1 Id is Event2 parent_id&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;This is my query:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="faults" Id=a8015353-18bf-11ec-8b0a-7c2a311251af
| join type=outer AxesId [search index="axes" | rename id AS AxesId]
| table *&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;And this is the output table.&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="25%"&gt;Id&lt;/TD&gt;&lt;TD width="25%"&gt;AxesId&lt;/TD&gt;&lt;TD width="25%"&gt;TR&lt;/TD&gt;&lt;TD width="12.5%"&gt;table&lt;/TD&gt;&lt;TD width="12.5%"&gt;couch&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%"&gt;a8015353-18bf-11ec-8b0a-7c2a311251af&lt;/TD&gt;&lt;TD width="25%"&gt;a8015354-18bf-11ec-b3bb-7c2a311251af&lt;/TD&gt;&lt;TD width="25%"&gt;3&lt;/TD&gt;&lt;TD width="12.5%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="12.5%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Event 2 columns are there but have no information.&lt;BR /&gt;Any help would be welcomed.&lt;BR /&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 19 Sep 2021 09:51:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Outer-join-not-working/m-p/567536#M197792</guid>
      <dc:creator>fvarela</dc:creator>
      <dc:date>2021-09-19T09:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: Outer join not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Outer-join-not-working/m-p/567542#M197795</link>
      <description>&lt;P&gt;That looks like it should work so I don't understand why it isn't.&amp;nbsp; Try this alternative.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index="faults" Id=a8015353-18bf-11ec-8b0a-7c2a311251af) OR
(index="axes")
| eval Id=coalesce(Id, AxesId]
| stats values(*) as * by Id
| table *&lt;/LI-CODE&gt;</description>
      <pubDate>Sun, 19 Sep 2021 13:11:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Outer-join-not-working/m-p/567542#M197795</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-09-19T13:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: Outer join not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Outer-join-not-working/m-p/567543#M197796</link>
      <description>&lt;P&gt;Thanks for your help richgalloway but no, it is not working yet.&lt;BR /&gt;The output table only has elements from event1&lt;/P&gt;&lt;P&gt;If I replace your code with this (Note that event1 has 'Id' field with capital I while event2 has 'id'):&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index="faults" Id=a8015353-18bf-11ec-8b0a-7c2a311251af) OR
(index="axes")
| eval Id=coalesce(Id, id)
| stats values(*) as * by Id
| table *&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then it outputs a table with:&lt;BR /&gt;index "faults" -&amp;gt; event1&lt;BR /&gt;index "axes" -&amp;gt; all the events on this index&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 19 Sep 2021 13:27:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Outer-join-not-working/m-p/567543#M197796</guid>
      <dc:creator>fvarela</dc:creator>
      <dc:date>2021-09-19T13:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: Outer join not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Outer-join-not-working/m-p/567546#M197798</link>
      <description>&lt;P&gt;Perhaps I got the fields confused.&amp;nbsp; The field in the &lt;FONT face="courier new,courier"&gt;by&lt;/FONT&gt; clause of the &lt;FONT face="courier new,courier"&gt;stats&lt;/FONT&gt; command must be one that contains a value shared by events in both indexes.&lt;/P&gt;</description>
      <pubDate>Sun, 19 Sep 2021 14:19:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Outer-join-not-working/m-p/567546#M197798</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-09-19T14:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: Outer join not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Outer-join-not-working/m-p/567560#M197808</link>
      <description>&lt;P&gt;That id vs Id capitalization issue was driving me nuts so I fix it so that all the fields are extracted using the same convention (lower case with _ for separating words).&lt;BR /&gt;That fixed somehow my issue with the outer join.&lt;BR /&gt;Now this query works as expected:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="faults" id=3bdbced1-1958-11ec-894e-7c2a311251af
|join type=outer axes_id [search index="axes" | rename id as axes_id]
|table tr, table, couch&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;So the issue is solved but I don't really know what was wrong with the first query.&lt;/P&gt;</description>
      <pubDate>Sun, 19 Sep 2021 19:09:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Outer-join-not-working/m-p/567560#M197808</guid>
      <dc:creator>fvarela</dc:creator>
      <dc:date>2021-09-19T19:09:52Z</dc:date>
    </item>
  </channel>
</rss>

