<?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: Merge multipe lookup files in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Merge-multipe-lookup-files/m-p/125917#M34051</link>
    <description>&lt;P&gt;I thought using append and then piping it to transaction Name but for some reason that doesn't return any results?&lt;/P&gt;</description>
    <pubDate>Fri, 01 Nov 2013 13:16:40 GMT</pubDate>
    <dc:creator>rdownie</dc:creator>
    <dc:date>2013-11-01T13:16:40Z</dc:date>
    <item>
      <title>Merge multipe lookup files</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Merge-multipe-lookup-files/m-p/125915#M34049</link>
      <description>&lt;P&gt;I am trying to merge 3 lookup files having them join on one field but keep all additional fields and records(that don't join) in the output. I have tried join type=outer but that appears to only keep all records from one side of the join.&lt;/P&gt;

&lt;P&gt;File 1:&lt;BR /&gt;&lt;BR /&gt;
Hostname, IP, MAC&lt;BR /&gt;&lt;BR /&gt;
A,192.168.1.1,MACC&lt;BR /&gt;&lt;BR /&gt;
D,192.168.1.2,MACF&lt;BR /&gt;&lt;BR /&gt;
G,192.168.1.3,MACI&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;File 2:&lt;BR /&gt;
Hostname, Owner, Location&lt;BR /&gt;&lt;BR /&gt;
A,John,Boston&lt;BR /&gt;&lt;BR /&gt;
J,Tom,NewYork&lt;BR /&gt;&lt;BR /&gt;
M,Fred,Cleveland&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;File 3:&lt;BR /&gt;&lt;BR /&gt;
Hostname,Switch,Port&lt;BR /&gt;&lt;BR /&gt;
A,B0K-mdfa,FA/02&lt;BR /&gt;&lt;BR /&gt;
J,B0K-mdfa,FA/03&lt;BR /&gt;&lt;BR /&gt;
X,B1K-mdfb,FA/03&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;I want the results to have:&lt;BR /&gt;&lt;BR /&gt;
Hostname,IP,MAC,Owner,Location,Switch,Port&lt;BR /&gt;&lt;BR /&gt;
A,192.168.1.1,MACC,John,Boston,B0K-mdfa,FA/02&lt;BR /&gt;&lt;BR /&gt;
D,192.168.1.2,MACF,,,,,&lt;BR /&gt;&lt;BR /&gt;
G,192.168.1.3,MACI,,,,,&lt;BR /&gt;&lt;BR /&gt;
J,,,Tom,NewYork,B0K-mdfa,FA/03&lt;BR /&gt;&lt;BR /&gt;
M,,,Fred,Cleveland,,,&lt;BR /&gt;&lt;BR /&gt;
X,,,,,B1K-mdfb,FA&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;Basically, this is what I have been trying:&lt;BR /&gt;&lt;BR /&gt;
| inputlookup File1  | join  type=outer Name [|inputlookup File2 ] | join type=outer  Name [|inputlookup File3 ]&lt;BR /&gt;&lt;BR /&gt;
What happens is what I would expect, I get all records from file 1, those that join to it from File 2 and then those that join to that from file 3 when I want all records from all 3 files basically merged on Name. I tried using append but that won't work either. Any ideas?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
-Bob&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2013 13:08:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Merge-multipe-lookup-files/m-p/125915#M34049</guid>
      <dc:creator>rdownie</dc:creator>
      <dc:date>2013-11-01T13:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: Merge multipe lookup files</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Merge-multipe-lookup-files/m-p/125916#M34050</link>
      <description>&lt;P&gt;Why not just use the lookup files the way they're intended to be used, as lookups?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup File1 | lookup File2 Hostname | lookup File3 Name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;EDIT: Updated version which gets all the Hostnames to begin with:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup File1 | fields Hostname | append [|inputlookup File2 | fields Hostname] | append [|inputlookup File3 Hostname] | dedup Hostname | lookup File1 Hostname | lookup File2 Hostname | lookup File3 Hostname
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Nov 2013 13:12:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Merge-multipe-lookup-files/m-p/125916#M34050</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-11-01T13:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: Merge multipe lookup files</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Merge-multipe-lookup-files/m-p/125917#M34051</link>
      <description>&lt;P&gt;I thought using append and then piping it to transaction Name but for some reason that doesn't return any results?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2013 13:16:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Merge-multipe-lookup-files/m-p/125917#M34051</guid>
      <dc:creator>rdownie</dc:creator>
      <dc:date>2013-11-01T13:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: Merge multipe lookup files</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Merge-multipe-lookup-files/m-p/125918#M34052</link>
      <description>&lt;P&gt;That is only going to give me the records that match from file 1 in file 2 and file 3. I need the records from all 3 files merged, regardless if they are found in the other files.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2013 13:31:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Merge-multipe-lookup-files/m-p/125918#M34052</guid>
      <dc:creator>rdownie</dc:creator>
      <dc:date>2013-11-01T13:31:47Z</dc:date>
    </item>
    <item>
      <title>Re: Merge multipe lookup files</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Merge-multipe-lookup-files/m-p/125919#M34053</link>
      <description>&lt;P&gt;Fair enough - updated my answer with an approach that will grab all the hostnames first of all.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2013 13:37:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Merge-multipe-lookup-files/m-p/125919#M34053</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-11-01T13:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: Merge multipe lookup files</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Merge-multipe-lookup-files/m-p/125920#M34054</link>
      <description>&lt;P&gt;Extending answer from Ayn -&amp;gt;&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;|inputlookup File1 | fields Hostname |&lt;BR /&gt;
append [|inputlookup File2 | fields&lt;BR /&gt;
Hostname] | append [|inputlookup File3&lt;BR /&gt;
Hostname] | dedup Hostname | join&lt;BR /&gt;
type=outer Hostname [|inputlookup&lt;BR /&gt;
File1] | join type=outer Hostname&lt;BR /&gt;
[|inputlookup File2]| join type=outer&lt;BR /&gt;
Hostname [|inputlookup File3]&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Fri, 01 Nov 2013 13:45:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Merge-multipe-lookup-files/m-p/125920#M34054</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2013-11-01T13:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: Merge multipe lookup files</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Merge-multipe-lookup-files/m-p/125921#M34055</link>
      <description>&lt;P&gt;I was just taking that approach. &lt;BR /&gt;
Thanks!!!&lt;BR /&gt;
-Bob&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2013 14:04:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Merge-multipe-lookup-files/m-p/125921#M34055</guid>
      <dc:creator>rdownie</dc:creator>
      <dc:date>2013-11-01T14:04:03Z</dc:date>
    </item>
  </channel>
</rss>

