<?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: Joining values from two indexes and returning just specific values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Joining-values-from-two-indexes-and-returning-just-specific/m-p/393297#M114414</link>
    <description>&lt;P&gt;Didn't work, that's what I was trying. The contact field always comes back null....&lt;/P&gt;</description>
    <pubDate>Wed, 14 Nov 2018 21:28:30 GMT</pubDate>
    <dc:creator>splunker1981</dc:creator>
    <dc:date>2018-11-14T21:28:30Z</dc:date>
    <item>
      <title>Joining values from two indexes and returning just specific values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Joining-values-from-two-indexes-and-returning-just-specific/m-p/393293#M114410</link>
      <description>&lt;P&gt;Hello fellow Splunkers&lt;/P&gt;

&lt;P&gt;I'm trying to figure out how to join values from 2 indexes and return  one field (from one of the indexes) based on a match.  For example; we have inventory IDs (e_id) in 1 index and contact details in another - both indexes have a unique ID value that's used to group things together (e_id field)&lt;/P&gt;

&lt;P&gt;I'd like to run a search that returns just the contact  field/value when the ID matches 1 to 1 with the numerical ID coming back in a search. &lt;/P&gt;

&lt;P&gt;For example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;indexA
e_length
e_location
e_id
e_category

indexB
weight
last_shipment
e_id
contact
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'd like to join on the e_id field and return only the contact information from indexB when both id fields match.&lt;/P&gt;

&lt;P&gt;something like &lt;STRONG&gt;&lt;EM&gt;|table e_length, e_location, e_id, e_category, contact&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:03:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Joining-values-from-two-indexes-and-returning-just-specific/m-p/393293#M114410</guid>
      <dc:creator>splunker1981</dc:creator>
      <dc:date>2020-09-29T22:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: Joining values from two indexes and returning just specific values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Joining-values-from-two-indexes-and-returning-just-specific/m-p/393294#M114411</link>
      <description>&lt;P&gt;you should be able to do that with a join&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=A ... 
| join e_id 
    [ search index=B ...      | fields contact ]
 | table e_length, e_location, e_id, e_category, contact
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Nov 2018 20:40:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Joining-values-from-two-indexes-and-returning-just-specific/m-p/393294#M114411</guid>
      <dc:creator>kmaron</dc:creator>
      <dc:date>2018-11-14T20:40:06Z</dc:date>
    </item>
    <item>
      <title>Re: Joining values from two indexes and returning just specific values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Joining-values-from-two-indexes-and-returning-just-specific/m-p/393295#M114412</link>
      <description>&lt;P&gt;I should've stated that I had this working with join.  However, upon further reading it seems like the recommendation is to avoid join AND append when possible.   But I couldn't get it working with stats...&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2018 20:52:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Joining-values-from-two-indexes-and-returning-just-specific/m-p/393295#M114412</guid>
      <dc:creator>splunker1981</dc:creator>
      <dc:date>2018-11-14T20:52:47Z</dc:date>
    </item>
    <item>
      <title>Re: Joining values from two indexes and returning just specific values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Joining-values-from-two-indexes-and-returning-just-specific/m-p/393296#M114413</link>
      <description>&lt;P&gt;you're not wrong.   try this instead. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=A OR index=B
 | stats values(e_length) as e_length values(e_location) as e_location values(e_category) as e_category values(contact) as contact by e_id
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Nov 2018 20:55:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Joining-values-from-two-indexes-and-returning-just-specific/m-p/393296#M114413</guid>
      <dc:creator>kmaron</dc:creator>
      <dc:date>2018-11-14T20:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: Joining values from two indexes and returning just specific values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Joining-values-from-two-indexes-and-returning-just-specific/m-p/393297#M114414</link>
      <description>&lt;P&gt;Didn't work, that's what I was trying. The contact field always comes back null....&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2018 21:28:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Joining-values-from-two-indexes-and-returning-just-specific/m-p/393297#M114414</guid>
      <dc:creator>splunker1981</dc:creator>
      <dc:date>2018-11-14T21:28:30Z</dc:date>
    </item>
    <item>
      <title>Re: Joining values from two indexes and returning just specific values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Joining-values-from-two-indexes-and-returning-just-specific/m-p/393298#M114415</link>
      <description>&lt;P&gt;that's really odd.  the join works but the stats doesn't? &lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2018 21:29:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Joining-values-from-two-indexes-and-returning-just-specific/m-p/393298#M114415</guid>
      <dc:creator>kmaron</dc:creator>
      <dc:date>2018-11-14T21:29:41Z</dc:date>
    </item>
    <item>
      <title>Re: Joining values from two indexes and returning just specific values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Joining-values-from-two-indexes-and-returning-just-specific/m-p/393299#M114416</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;

&lt;P&gt;Give this a shot :&lt;BR /&gt;
  index=A OR index=B&lt;BR /&gt;
  | stats values(contact) as contact values(index) as index  by e_id&lt;BR /&gt;
  | search index=A AND index=B&lt;/P&gt;

&lt;P&gt;That will give you contacts that have their e_id in both indexes. Add the other values you need after the stats.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
David&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2018 23:15:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Joining-values-from-two-indexes-and-returning-just-specific/m-p/393299#M114416</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2018-11-14T23:15:16Z</dc:date>
    </item>
  </channel>
</rss>

