<?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: Right join in Splunk in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Right-join-in-Splunk/m-p/76262#M15560</link>
    <description>&lt;P&gt;That did not really entirely help.&lt;/P&gt;

&lt;P&gt;Here is a new query for review:&lt;/P&gt;

&lt;P&gt;sourcetype="alphalog" | dedup ModuleNum | eval MNumber=ModuleNum| join MNumber[ search sourcetype="betalog" fields MName ]&lt;/P&gt;</description>
    <pubDate>Thu, 03 Jan 2013 01:03:57 GMT</pubDate>
    <dc:creator>asarolkar</dc:creator>
    <dc:date>2013-01-03T01:03:57Z</dc:date>
    <item>
      <title>Right join in Splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Right-join-in-Splunk/m-p/76260#M15558</link>
      <description>&lt;P&gt;I have two sourcetypes that have a field that does not have the same name in both places (but has the same values)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;i) sourcetype="alphalog" ModuleNum=* | dedup ModuleNum 

ii) sourcetype="betalog" MNumber=* | table MNumber
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please note that sourcetype="betalog" has another field called MName.&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;
&lt;BR /&gt;&lt;BR /&gt;
I need to write a Splunk query that basically does this -&amp;gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Select betalog.MName from both sourcetypes where alphalog.ModuleNum = betalog.MNumber&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Is there a query that does a join like this in Splunk ?&lt;/P&gt;

&lt;P&gt;Any help would be appreciated&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jan 2013 23:43:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Right-join-in-Splunk/m-p/76260#M15558</guid>
      <dc:creator>asarolkar</dc:creator>
      <dc:date>2013-01-02T23:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: Right join in Splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Right-join-in-Splunk/m-p/76261#M15559</link>
      <description>&lt;P&gt;sourcetype=alphalog | JOIN type=inner ModuleNum [ search sourcetype=betalog]&lt;BR /&gt;&lt;BR /&gt;
OR  this search...&lt;BR /&gt;&lt;BR /&gt;
sourcetype=alphalog [ search sourcetype=betalog MNumber=* | FIELDS MNumber ]&lt;/P&gt;

&lt;P&gt;I think at least one of  the two examples above should work if Im following. Check out: &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Join"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Join&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;
You might find this link useful as well:&lt;BR /&gt;&lt;BR /&gt;
&lt;A href="http://www.innovato.com/splunk/SQLSplunk.html"&gt;http://www.innovato.com/splunk/SQLSplunk.html&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2013 00:40:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Right-join-in-Splunk/m-p/76261#M15559</guid>
      <dc:creator>rroberts</dc:creator>
      <dc:date>2013-01-03T00:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: Right join in Splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Right-join-in-Splunk/m-p/76262#M15560</link>
      <description>&lt;P&gt;That did not really entirely help.&lt;/P&gt;

&lt;P&gt;Here is a new query for review:&lt;/P&gt;

&lt;P&gt;sourcetype="alphalog" | dedup ModuleNum | eval MNumber=ModuleNum| join MNumber[ search sourcetype="betalog" fields MName ]&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2013 01:03:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Right-join-in-Splunk/m-p/76262#M15560</guid>
      <dc:creator>asarolkar</dc:creator>
      <dc:date>2013-01-03T01:03:57Z</dc:date>
    </item>
    <item>
      <title>Re: Right join in Splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Right-join-in-Splunk/m-p/76263#M15561</link>
      <description>&lt;P&gt;Are you sure that you need to &lt;CODE&gt;join&lt;/CODE&gt;? That's a pretty expensive operation, performance wise.&lt;BR /&gt;
From your original question, you want to get the betalog.MName from betalog, where the values for ModuleNum/MNumber are the same. What more do you need from alphalog? Nothing? Just a listing of beta.MNames by alpha.ModuleNum?&lt;/P&gt;

&lt;P&gt;It's always good practice to give a few sample events and describe the output you desire.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=betalog [search sourcetype=alphalog ModuleNum=* | dedup ModuleNum | rename ModuleNum as MNumber | fields + MNumber] | stats values(MName) by MNumber 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This could work...but it depends on what you actually want. The subsearch (within the square brackets) returns a 'list' of unique ModuleNums (renamed as MNumbers) to the outer search. Then it's just a question of how you want to use that.&lt;/P&gt;

&lt;P&gt;Kristian&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2013 13:46:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Right-join-in-Splunk/m-p/76263#M15561</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-01-03T13:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: Right join in Splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Right-join-in-Splunk/m-p/76264#M15562</link>
      <description>&lt;P&gt;Very helpful. Thanks !&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2013 17:44:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Right-join-in-Splunk/m-p/76264#M15562</guid>
      <dc:creator>asarolkar</dc:creator>
      <dc:date>2013-01-03T17:44:34Z</dc:date>
    </item>
  </channel>
</rss>

