<?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 Unexpected inner join results in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Unexpected-inner-join-results/m-p/211249#M61770</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have two tables like below:&lt;/P&gt;

&lt;P&gt;table 1 (nl_t1.csv):&lt;BR /&gt;
IP     Source1&lt;BR /&gt;
1      a&lt;BR /&gt;
1      b&lt;/P&gt;

&lt;P&gt;table 2 (nl_t2.csv):&lt;BR /&gt;
IP     Source2&lt;BR /&gt;
1      c&lt;BR /&gt;
1      d&lt;BR /&gt;
1      e&lt;/P&gt;

&lt;P&gt;when I conduct inner join using the following code:&lt;BR /&gt;
| inputlookup nl_t1.csv&lt;BR /&gt;
| join IP [|inputlookup nl_t2.csv]&lt;/P&gt;

&lt;P&gt;The results is:&lt;BR /&gt;
IP    Source1  Source2&lt;BR /&gt;
1      a              c&lt;BR /&gt;
1      a              d&lt;BR /&gt;
1      a              e&lt;/P&gt;

&lt;P&gt;It seems that it only used the first row of table 1. What I expected is the results should have 6 (2 X 3) rows like below:&lt;BR /&gt;
IP    Source1   Source2&lt;BR /&gt;
1     a                c&lt;BR /&gt;
1     a                d&lt;BR /&gt;
1     a                e&lt;BR /&gt;
1     b                c&lt;BR /&gt;
1     b                d&lt;BR /&gt;
1     b                e&lt;/P&gt;

&lt;P&gt;Could anyone give an explanation or suggest a solution to get the right results?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Wayne&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 09:27:52 GMT</pubDate>
    <dc:creator>xiangtaner</dc:creator>
    <dc:date>2020-09-29T09:27:52Z</dc:date>
    <item>
      <title>Unexpected inner join results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unexpected-inner-join-results/m-p/211249#M61770</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have two tables like below:&lt;/P&gt;

&lt;P&gt;table 1 (nl_t1.csv):&lt;BR /&gt;
IP     Source1&lt;BR /&gt;
1      a&lt;BR /&gt;
1      b&lt;/P&gt;

&lt;P&gt;table 2 (nl_t2.csv):&lt;BR /&gt;
IP     Source2&lt;BR /&gt;
1      c&lt;BR /&gt;
1      d&lt;BR /&gt;
1      e&lt;/P&gt;

&lt;P&gt;when I conduct inner join using the following code:&lt;BR /&gt;
| inputlookup nl_t1.csv&lt;BR /&gt;
| join IP [|inputlookup nl_t2.csv]&lt;/P&gt;

&lt;P&gt;The results is:&lt;BR /&gt;
IP    Source1  Source2&lt;BR /&gt;
1      a              c&lt;BR /&gt;
1      a              d&lt;BR /&gt;
1      a              e&lt;/P&gt;

&lt;P&gt;It seems that it only used the first row of table 1. What I expected is the results should have 6 (2 X 3) rows like below:&lt;BR /&gt;
IP    Source1   Source2&lt;BR /&gt;
1     a                c&lt;BR /&gt;
1     a                d&lt;BR /&gt;
1     a                e&lt;BR /&gt;
1     b                c&lt;BR /&gt;
1     b                d&lt;BR /&gt;
1     b                e&lt;/P&gt;

&lt;P&gt;Could anyone give an explanation or suggest a solution to get the right results?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Wayne&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:27:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unexpected-inner-join-results/m-p/211249#M61770</guid>
      <dc:creator>xiangtaner</dc:creator>
      <dc:date>2020-09-29T09:27:52Z</dc:date>
    </item>
    <item>
      <title>Re: Unexpected inner join results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unexpected-inner-join-results/m-p/211250#M61771</link>
      <description>&lt;P&gt;Hi xiangtaner,&lt;/P&gt;

&lt;P&gt;try using a &lt;CODE&gt;stats&lt;/CODE&gt; instead:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | inputlookup nl_t1.csv | inputlookup append=t nl_t2.csv | stats values(*) AS * by IP
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2016 01:08:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unexpected-inner-join-results/m-p/211250#M61771</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2016-04-21T01:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: Unexpected inner join results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unexpected-inner-join-results/m-p/211251#M61772</link>
      <description>&lt;P&gt;In case you are wondering why your join doesn't work as expected try this instead:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup nl_t1.csv
| join IP max=0 [|inputlookup nl_t2.csv]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is the way the max parameter works:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;max
Syntax: max=&amp;lt;int&amp;gt;
Description: Specifies the maximum number of subsearch results that each main search result can join with. If set to max=0, there is no limit.
Default: 1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Apr 2016 08:52:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unexpected-inner-join-results/m-p/211251#M61772</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-04-21T08:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: Unexpected inner join results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unexpected-inner-join-results/m-p/211252#M61773</link>
      <description>&lt;P&gt;Thanks MuS and javiergn for the inputs, javiergn's way works perfect!&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2016 13:56:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unexpected-inner-join-results/m-p/211252#M61773</guid>
      <dc:creator>xiangtaner</dc:creator>
      <dc:date>2016-04-21T13:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: Unexpected inner join results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unexpected-inner-join-results/m-p/211253#M61774</link>
      <description>&lt;P&gt;Just a side note: It can most likely be done without &lt;CODE&gt;join&lt;/CODE&gt; .. See the March Session of @sideview here &lt;A href="http://wiki.splunk.com/Virtual_.conf"&gt;http://wiki.splunk.com/Virtual_.conf&lt;/A&gt; or this answer &lt;A href="https://answers.splunk.com/answers/129424/how-to-compare-fields-over-multiple-sourcetypes-without-join-append-or-use-of-subsearches.html"&gt;https://answers.splunk.com/answers/129424/how-to-compare-fields-over-multiple-sourcetypes-without-join-append-or-use-of-subsearches.html&lt;/A&gt; to learn more about this topic.&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2016 11:47:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unexpected-inner-join-results/m-p/211253#M61774</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2016-04-22T11:47:18Z</dc:date>
    </item>
  </channel>
</rss>

