<?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: Example of left outer join in Splunk without using join? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Example-of-left-outer-join-in-Splunk-without-using-join/m-p/162584#M46126</link>
    <description>&lt;P&gt;If "one" is already ran as a base search, would it still be faster to re-run one in one OR two, or would it then make sense to use append if you decide to re-use the one base search?  this is my situation.&lt;/P&gt;</description>
    <pubDate>Thu, 09 Jan 2020 20:44:27 GMT</pubDate>
    <dc:creator>weidertc</dc:creator>
    <dc:date>2020-01-09T20:44:27Z</dc:date>
    <item>
      <title>Example of left outer join in Splunk without using join?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Example-of-left-outer-join-in-Splunk-without-using-join/m-p/162580#M46122</link>
      <description>&lt;P&gt;Please help me with a good example of Left Outer Join in Splunk without using "Join."  I've seen examples of Inner Join without using "Join", but I haven't found one for Left Outer Join.  &lt;/P&gt;

&lt;P&gt;Thanks in advance!!!&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jul 2014 00:29:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Example-of-left-outer-join-in-Splunk-without-using-join/m-p/162580#M46122</guid>
      <dc:creator>anwarmian</dc:creator>
      <dc:date>2014-07-30T00:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: Example of left outer join in Splunk without using join?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Example-of-left-outer-join-in-Splunk-without-using-join/m-p/162581#M46123</link>
      <description>&lt;P&gt;Say you have sourcetypes &lt;CODE&gt;one&lt;/CODE&gt; with field &lt;CODE&gt;bar&lt;/CODE&gt; and &lt;CODE&gt;two&lt;/CODE&gt; with field &lt;CODE&gt;baz&lt;/CODE&gt;, and a common field foo. You'd search that using sourcetype=one OR sourcetype=two, or generate dummy data using this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats count as sourcetype | eval sourcetype="one" | eval foo = "a b c"| makemv foo | mvexpand foo | eval bar = random()%42 | append [stats count as sourcetype | eval sourcetype="two" | eval foo = "b c d" | makemv foo | mvexpand foo | eval baz = random()%42]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That generates three events &lt;CODE&gt;a,b,c&lt;/CODE&gt; from sourcetype &lt;CODE&gt;one&lt;/CODE&gt; and three events &lt;CODE&gt;b,c,d&lt;/CODE&gt; from sourcetype &lt;CODE&gt;two&lt;/CODE&gt;. Left outer joining those should yield three events &lt;CODE&gt;a,b,c&lt;/CODE&gt;, with no value for &lt;CODE&gt;baz&lt;/CODE&gt; in case of &lt;CODE&gt;a&lt;/CODE&gt; because sourctype &lt;CODE&gt;two&lt;/CODE&gt; didn't have that.&lt;/P&gt;

&lt;P&gt;Append this to compute that join:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats values(sourcetype) as sourcetype values(bar) as bar values(baz) as baz by foo | search sourcetype="one"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You should get a result like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;foo  sourcetype  bar  baz
a    one           6
b    one           7   41
     two
c    one           8   18
     two
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Leave off the final search to get a full outer join.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jul 2014 00:50:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Example-of-left-outer-join-in-Splunk-without-using-join/m-p/162581#M46123</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-07-30T00:50:53Z</dc:date>
    </item>
    <item>
      <title>Re: Example of left outer join in Splunk without using join?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Example-of-left-outer-join-in-Splunk-without-using-join/m-p/162582#M46124</link>
      <description>&lt;P&gt;Thanks so much Martin.  I'll try it out.  Since I heard that  "join" is expensive would "append" make the search faster?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jul 2014 04:00:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Example-of-left-outer-join-in-Splunk-without-using-join/m-p/162582#M46124</guid>
      <dc:creator>anwarmian</dc:creator>
      <dc:date>2014-07-30T04:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: Example of left outer join in Splunk without using join?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Example-of-left-outer-join-in-Splunk-without-using-join/m-p/162583#M46125</link>
      <description>&lt;P&gt;They do different things, so they aren't really comparable.&lt;/P&gt;

&lt;P&gt;There's no need to use &lt;CODE&gt;append&lt;/CODE&gt; in this case. My dummy data generator uses it, but it's not meant to churn out many events quickly.&lt;BR /&gt;
Don't:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=one | some stuff | append [search sourcetype=two | some stuff] | stats ... by foo
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Do:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=one OR sourcetype=two | some stuff | stats ... by foo
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That'll be miles faster than either &lt;CODE&gt;join&lt;/CODE&gt; or &lt;CODE&gt;append&lt;/CODE&gt; based approaches.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jul 2014 07:09:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Example-of-left-outer-join-in-Splunk-without-using-join/m-p/162583#M46125</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-07-30T07:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: Example of left outer join in Splunk without using join?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Example-of-left-outer-join-in-Splunk-without-using-join/m-p/162584#M46126</link>
      <description>&lt;P&gt;If "one" is already ran as a base search, would it still be faster to re-run one in one OR two, or would it then make sense to use append if you decide to re-use the one base search?  this is my situation.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 20:44:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Example-of-left-outer-join-in-Splunk-without-using-join/m-p/162584#M46126</guid>
      <dc:creator>weidertc</dc:creator>
      <dc:date>2020-01-09T20:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: Example of left outer join in Splunk without using join?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Example-of-left-outer-join-in-Splunk-without-using-join/m-p/162585#M46127</link>
      <description>&lt;P&gt;dashboard?&lt;BR /&gt;
query optimization  is specific. it's better you provide your sample query.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 21:30:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Example-of-left-outer-join-in-Splunk-without-using-join/m-p/162585#M46127</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-09T21:30:00Z</dc:date>
    </item>
  </channel>
</rss>

