<?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: how to generate a third table with &amp;quot;join&amp;quot; command? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-generate-a-third-table-with-quot-join-quot-command/m-p/112299#M29498</link>
    <description>&lt;P&gt;But I guess events won't have BOTH x and b. Rather you'll have events with x and y in one index, and other events with a, b and c in another. So "where x=b" will never match.&lt;/P&gt;</description>
    <pubDate>Sat, 29 Mar 2014 08:20:51 GMT</pubDate>
    <dc:creator>Ayn</dc:creator>
    <dc:date>2014-03-29T08:20:51Z</dc:date>
    <item>
      <title>how to generate a third table with "join" command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-generate-a-third-table-with-quot-join-quot-command/m-p/112297#M29496</link>
      <description>&lt;P&gt;suppose there are indexes A(x,y) and B(a,b,c).  Is it possible to generate a new index C (a,b,c,y) based on that the x field in A (x,y) matches b field in B(a,b,c)?  Thanks for your help!  &lt;/P&gt;</description>
      <pubDate>Sat, 29 Mar 2014 05:32:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-generate-a-third-table-with-quot-join-quot-command/m-p/112297#M29496</guid>
      <dc:creator>will4t</dc:creator>
      <dc:date>2014-03-29T05:32:35Z</dc:date>
    </item>
    <item>
      <title>Re: how to generate a third table with "join" command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-generate-a-third-table-with-quot-join-quot-command/m-p/112298#M29497</link>
      <description>&lt;P&gt;hi will4t,&lt;/P&gt;

&lt;P&gt;if I get you correct and you want to match two fields from two indexes and display some other fields as result, try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=A OR index=B | where x=b | table a, b, c ,y
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Sat, 29 Mar 2014 07:15:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-generate-a-third-table-with-quot-join-quot-command/m-p/112298#M29497</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-03-29T07:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: how to generate a third table with "join" command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-generate-a-third-table-with-quot-join-quot-command/m-p/112299#M29498</link>
      <description>&lt;P&gt;But I guess events won't have BOTH x and b. Rather you'll have events with x and y in one index, and other events with a, b and c in another. So "where x=b" will never match.&lt;/P&gt;</description>
      <pubDate>Sat, 29 Mar 2014 08:20:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-generate-a-third-table-with-quot-join-quot-command/m-p/112299#M29498</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2014-03-29T08:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to generate a third table with "join" command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-generate-a-third-table-with-quot-join-quot-command/m-p/112300#M29499</link>
      <description>&lt;P&gt;Even if x value matches b then won't exist in the same event or position to match. So the join should go like&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index A|join x[|search index B|rename b as x]|table a,b,c,y&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;or &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index A|rename x as b|join b[|search index B]|table a,b,c,y&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Mar 2014 08:46:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-generate-a-third-table-with-quot-join-quot-command/m-p/112300#M29499</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2014-03-29T08:46:47Z</dc:date>
    </item>
    <item>
      <title>Re: how to generate a third table with "join" command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-generate-a-third-table-with-quot-join-quot-command/m-p/112301#M29500</link>
      <description>&lt;P&gt;Ayn is right, still I would avoid to use &lt;CODE&gt;join&lt;/CODE&gt; when ever it is possible. Maybe &lt;CODE&gt;streamstats&lt;/CODE&gt; could be of help here .....&lt;/P&gt;</description>
      <pubDate>Sat, 29 Mar 2014 12:33:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-generate-a-third-table-with-quot-join-quot-command/m-p/112301#M29500</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-03-29T12:33:09Z</dc:date>
    </item>
    <item>
      <title>Re: how to generate a third table with "join" command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-generate-a-third-table-with-quot-join-quot-command/m-p/112302#M29501</link>
      <description>&lt;P&gt;Correct answer should be linu1988s. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=A x=* | rename x as b | join b [ search index=B b=*] | table a, b, c, y
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I added &lt;CODE&gt;x=*&lt;/CODE&gt; and &lt;CODE&gt;b=&lt;/CODE&gt;* to be sure to extract events with fields x and b with some value. &lt;/P&gt;

&lt;P&gt;Marco&lt;/P&gt;</description>
      <pubDate>Sat, 29 Mar 2014 12:54:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-generate-a-third-table-with-quot-join-quot-command/m-p/112302#M29501</guid>
      <dc:creator>marcoscala</dc:creator>
      <dc:date>2014-03-29T12:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: how to generate a third table with "join" command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-generate-a-third-table-with-quot-join-quot-command/m-p/112303#M29502</link>
      <description>&lt;P&gt;Sorry Marco, but this answer is neither correct. If you add &lt;CODE&gt;x=*&lt;/CODE&gt; and &lt;CODE&gt;b=*&lt;/CODE&gt; to your base searches, you imply that &lt;CODE&gt;a&lt;/CODE&gt;,&lt;CODE&gt;c&lt;/CODE&gt; and &lt;CODE&gt;y&lt;/CODE&gt; are always present in either of the &lt;CODE&gt;x&lt;/CODE&gt; or &lt;CODE&gt;b&lt;/CODE&gt; events. If they are not, you get wrong or missing results. So linu1988's answer is still the best...&lt;/P&gt;</description>
      <pubDate>Mon, 31 Mar 2014 05:53:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-generate-a-third-table-with-quot-join-quot-command/m-p/112303#M29502</guid>
      <dc:creator>lcshared</dc:creator>
      <dc:date>2014-03-31T05:53:48Z</dc:date>
    </item>
    <item>
      <title>Re: how to generate a third table with "join" command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-generate-a-third-table-with-quot-join-quot-command/m-p/112304#M29503</link>
      <description>&lt;P&gt;Look, this is an example I just did friday for a Customer:&lt;BR /&gt;
&lt;CODE&gt;sourcetype="sap_fea" IVN=* id_elab =* | join type=outer id_elab,IVN [search sourcetype=sap_err ] | fillnull value=OK message | table _time, id_elab, IVN, success, message&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;where I had to merge data from sap_fea sourcetype contaning id_elab, IVN and success fields, with the "sap_err" sourcetype where, if there's and error in sap_fea, in the "message" fields there's the error description. If there's no error, I have no corresponding event in sourcetype "sap_err" and that's why I used outer join and "fillnull". &lt;/P&gt;

&lt;P&gt;And it works! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
Marco&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:16:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-generate-a-third-table-with-quot-join-quot-command/m-p/112304#M29503</guid>
      <dc:creator>marcoscala</dc:creator>
      <dc:date>2020-09-28T16:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: how to generate a third table with "join" command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-generate-a-third-table-with-quot-join-quot-command/m-p/112305#M29504</link>
      <description>&lt;P&gt;Here's a thought, assuming field values for b and x are unique:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=A OR index=B | rename x as b | stats values(a) as a values(c) as c values(y) as y by b
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You'll get a table roughly like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;b    a    c    y
b1   a1   c1   y1
b2   ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you have cases where a value for b/x only exists in one index and you want to get rid of those values you can add a &lt;CODE&gt;dc(index)&lt;/CODE&gt; to your &lt;CODE&gt;stats&lt;/CODE&gt; and &lt;CODE&gt;where&lt;/CODE&gt; out those with less than two distinct indexes.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Mar 2014 12:39:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-generate-a-third-table-with-quot-join-quot-command/m-p/112305#M29504</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-03-31T12:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: how to generate a third table with "join" command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-generate-a-third-table-with-quot-join-quot-command/m-p/112306#M29505</link>
      <description>&lt;P&gt;Sorry for my delaying reply.  I had problem with commenting.  I the idea from linu.  What I try to do is have a log index A and a small csv file B of signature or a mixture of IP address and subnets.  When the contents from B appeared in index A.  The match and the event was appended into index C dynamically.  Maybe join is not a good way to do the job.  Should use commends like inputlookup.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Apr 2014 01:53:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-generate-a-third-table-with-quot-join-quot-command/m-p/112306#M29505</guid>
      <dc:creator>will4t</dc:creator>
      <dc:date>2014-04-07T01:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: how to generate a third table with "join" command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-generate-a-third-table-with-quot-join-quot-command/m-p/112307#M29506</link>
      <description>&lt;P&gt;This answer can be valid.  But it needs to be tested to be sure.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Apr 2014 01:56:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-generate-a-third-table-with-quot-join-quot-command/m-p/112307#M29506</guid>
      <dc:creator>will4t</dc:creator>
      <dc:date>2014-04-07T01:56:35Z</dc:date>
    </item>
    <item>
      <title>Re: how to generate a third table with "join" command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-generate-a-third-table-with-quot-join-quot-command/m-p/112308#M29507</link>
      <description>&lt;P&gt;Marco's answer could be right.  sorry that I am late in commenting.  I am more concern with process time and power.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Apr 2014 02:17:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-generate-a-third-table-with-quot-join-quot-command/m-p/112308#M29507</guid>
      <dc:creator>will4t</dc:creator>
      <dc:date>2014-04-07T02:17:18Z</dc:date>
    </item>
    <item>
      <title>Re: how to generate a third table with "join" command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-generate-a-third-table-with-quot-join-quot-command/m-p/112309#M29508</link>
      <description>&lt;P&gt;Will4t, From your description, I thing you just need a regular lookup, nit a Join...&lt;/P&gt;

&lt;P&gt;What is still not clear to me, is why you need to create a new index C: do you need (and why) to store the result of the lookup somewhere?&lt;/P&gt;

&lt;P&gt;Marco&lt;/P&gt;</description>
      <pubDate>Mon, 07 Apr 2014 08:35:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-generate-a-third-table-with-quot-join-quot-command/m-p/112309#M29508</guid>
      <dc:creator>marcoscala</dc:creator>
      <dc:date>2014-04-07T08:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: how to generate a third table with "join" command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-generate-a-third-table-with-quot-join-quot-command/m-p/112310#M29509</link>
      <description>&lt;P&gt;Yes.  I noticed that I can avoid using join.  Creating a new index just is for sharing the information with the user group.&lt;/P&gt;</description>
      <pubDate>Sat, 12 Apr 2014 09:26:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-generate-a-third-table-with-quot-join-quot-command/m-p/112310#M29509</guid>
      <dc:creator>will4t</dc:creator>
      <dc:date>2014-04-12T09:26:38Z</dc:date>
    </item>
  </channel>
</rss>

