<?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 create one table by combining a common field with different field names from two sources? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-one-table-by-combining-a-common-field-with/m-p/245754#M73266</link>
    <description>&lt;P&gt;It doesn't work. I was wondering if NULL and empty fields is the same thing. &lt;/P&gt;</description>
    <pubDate>Thu, 26 Nov 2015 21:54:06 GMT</pubDate>
    <dc:creator>clairebesson</dc:creator>
    <dc:date>2015-11-26T21:54:06Z</dc:date>
    <item>
      <title>How to create one table by combining a common field with different field names from two sources?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-one-table-by-combining-a-common-field-with/m-p/245747#M73259</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;

&lt;P&gt;I am trying to combine two sources with a common field. &lt;BR /&gt;
The first source has the field &lt;STRONG&gt;LAN MAC Address&lt;/STRONG&gt; and the second has the field &lt;STRONG&gt;MAC Address&lt;/STRONG&gt;. These two fields are equals. &lt;BR /&gt;
I want to combine these two sources using this common field and create one table that regroup fields from source1 and fields from source2. &lt;/P&gt;

&lt;P&gt;Source1=awback.csv, fields = Status, Group, LAN MAC Address&lt;BR /&gt;
Source2= actback.csv, fields= Serial, PO Number, MAC Address&lt;/P&gt;

&lt;P&gt;Table desired: Status, Group, Serial, PO Number, MAC Address&lt;/P&gt;

&lt;P&gt;I tried two different methods but it didn't work:&lt;BR /&gt;
First method: using join&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup "awback.csv" | join "LAN MAC Address" [|inputlookup actback.csv | eval "MAC Address"=split("MAC Address",":") | mvexpand "MAC Address" | rename "MAC Address" as "LAN MAC Address"]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Second method using transaction:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="awback.csv" OR source="actback.csv" | rename "MAC Address" as "LAN MAC Address" | transaction "LAN MAC Address"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Could you please help with with that?&lt;BR /&gt;
Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2015 15:21:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-one-table-by-combining-a-common-field-with/m-p/245747#M73259</guid>
      <dc:creator>clairebesson</dc:creator>
      <dc:date>2015-11-25T15:21:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to create one table by combining a common field with different field names from two sources?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-one-table-by-combining-a-common-field-with/m-p/245748#M73260</link>
      <description>&lt;P&gt;What about someting like this:&lt;/P&gt;

&lt;P&gt;source="awback.csv" OR source="actback.csv" &lt;BR /&gt;
| rename "MAC Address" as LAN_MAC_Address, "LAN MAC Address" AS LAN_MAC_Address, "PO Number" AS PO_Number&lt;BR /&gt;
 | stats values(Status) AS Status, values(Group) AS Group, values(Serial) AS Serial, values(PO_Number) AS PO_Number BY LAN_MAC_Address&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:59:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-one-table-by-combining-a-common-field-with/m-p/245748#M73260</guid>
      <dc:creator>HeinzWaescher</dc:creator>
      <dc:date>2020-09-29T07:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to create one table by combining a common field with different field names from two sources?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-one-table-by-combining-a-common-field-with/m-p/245749#M73261</link>
      <description>&lt;P&gt;Thanks for your answer. It doesn't work. It only displays fields from actback.csv&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2015 15:51:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-one-table-by-combining-a-common-field-with/m-p/245749#M73261</guid>
      <dc:creator>clairebesson</dc:creator>
      <dc:date>2015-11-25T15:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to create one table by combining a common field with different field names from two sources?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-one-table-by-combining-a-common-field-with/m-p/245750#M73262</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup awback.csv | eval source="awback.csv"
| appendpipe [|inputlookup actback.csv | eval "MAC Address"=split("MAC Address",":") | mvexpand "MAC Address" | rename "MAC Address" as "LAN MAC Address" | eval source="actback.csv" ]
| stats dc(source) AS numSources values(*) AS * BY "LAN MAC Address"
| where numSources=2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Nov 2015 16:14:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-one-table-by-combining-a-common-field-with/m-p/245750#M73262</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-11-25T16:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to create one table by combining a common field with different field names from two sources?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-one-table-by-combining-a-common-field-with/m-p/245751#M73263</link>
      <description>&lt;P&gt;Thanks for your answer. Unfortunatly it doesn't work. In source 1 there are some values that are NULL for LAN MAC Address.  I don't know if it changes something... &lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2015 21:02:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-one-table-by-combining-a-common-field-with/m-p/245751#M73263</guid>
      <dc:creator>clairebesson</dc:creator>
      <dc:date>2015-11-25T21:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to create one table by combining a common field with different field names from two sources?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-one-table-by-combining-a-common-field-with/m-p/245752#M73264</link>
      <description>&lt;P&gt;If I understand correctly, this should work.&lt;/P&gt;

&lt;P&gt;|  inputlookup awback.csv | rename "LAN MAC Address" AS Mac | append [|inputlookup actback.csv | rename "MAC Adress" AS Mac ] | stats values(*) AS ** by Mac &lt;/P&gt;

&lt;P&gt;Supposed to be a single astrik &lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2015 23:08:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-one-table-by-combining-a-common-field-with/m-p/245752#M73264</guid>
      <dc:creator>carmackd</dc:creator>
      <dc:date>2015-11-25T23:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to create one table by combining a common field with different field names from two sources?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-one-table-by-combining-a-common-field-with/m-p/245753#M73265</link>
      <description>&lt;P&gt;OK, then try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup awback.csv | eval source="awback.csv" | eval "LAN MAC Address"=coalesce($LAN MAC Address$, "NULL")
| appendpipe [|inputlookup actback.csv | eval "MAC Address"=split("MAC Address",":") | mvexpand "MAC Address" | rename "MAC Address" as "LAN MAC Address" | eval source="actback.csv" ]
| stats dc(source) AS numSources values(*) AS * BY "LAN MAC Address"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Nov 2015 23:34:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-one-table-by-combining-a-common-field-with/m-p/245753#M73265</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-11-25T23:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to create one table by combining a common field with different field names from two sources?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-one-table-by-combining-a-common-field-with/m-p/245754#M73266</link>
      <description>&lt;P&gt;It doesn't work. I was wondering if NULL and empty fields is the same thing. &lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2015 21:54:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-one-table-by-combining-a-common-field-with/m-p/245754#M73266</guid>
      <dc:creator>clairebesson</dc:creator>
      <dc:date>2015-11-26T21:54:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to create one table by combining a common field with different field names from two sources?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-one-table-by-combining-a-common-field-with/m-p/245755#M73267</link>
      <description>&lt;P&gt;It absolutely should work unless you have not described your data correctly.  The only way to know for sure is to provide sample event data.&lt;/P&gt;</description>
      <pubDate>Sun, 29 Nov 2015 01:10:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-one-table-by-combining-a-common-field-with/m-p/245755#M73267</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-11-29T01:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to create one table by combining a common field with different field names from two sources?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-one-table-by-combining-a-common-field-with/m-p/245756#M73268</link>
      <description>&lt;P&gt;Here are sample of the data:&lt;BR /&gt;
source: awback.csv&lt;BR /&gt;
LAN MAC Address&lt;BR /&gt;
&lt;STRONG&gt;AB:34:dd:56:78:GF&lt;/STRONG&gt;&lt;BR /&gt;
(empty value)&lt;BR /&gt;
&lt;STRONG&gt;CB:34:ds:45:gd:45&lt;BR /&gt;
DR:45:ds:FR:56:G7&lt;/STRONG&gt;&lt;BR /&gt;
(empty value) etc...&lt;/P&gt;

&lt;P&gt;source: actback.csv&lt;BR /&gt;
MAC Address&lt;BR /&gt;
&lt;STRONG&gt;AB:34:dd:56:78:GF&lt;BR /&gt;
CB:34:ds:45:gd:45&lt;BR /&gt;
DR:45:ds:FR:56:G7&lt;/STRONG&gt;&lt;BR /&gt;
GT:45:33:eE:45:eD&lt;BR /&gt;
etc...&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2015 17:31:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-one-table-by-combining-a-common-field-with/m-p/245756#M73268</guid>
      <dc:creator>clairebesson</dc:creator>
      <dc:date>2015-11-30T17:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to create one table by combining a common field with different field names from two sources?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-one-table-by-combining-a-common-field-with/m-p/245757#M73269</link>
      <description>&lt;P&gt;I mocked up your sample data with my original solution and it works perfectly:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|noop|stats count AS "LAN MAC Address"
| eval "LAN MAC Address" = "AB:34:dd:56:78:GF,CB:34:ds:45:gd:45,DR:45:ds:FR:56:G7"
| makemv delim="," "LAN MAC Address" | mvexpand "LAN MAC Address"
| eval source="awback.csv"
| appendpipe [
|noop|stats count AS "MAC Address"
| eval "MAC Address" = "AB:34:dd:56:78:GF,CB:34:ds:45:gd:45,DR:45:ds:FR:56:G7,GT:45:33:eE:45:eD"
| makemv delim="," "MAC Address" | mvexpand "MAC Address"
| rename "MAC Address" as "LAN MAC Address"
| eval source = "actback.csv"]
| stats dc(source) AS numSources values(*) AS * BY "LAN MAC Address"
| where numSources=2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which results in this output:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  LAN MAC Address    numSources         source
AB:34:dd:56:78:GF             2    actback.csv
                                    awback.csv
CB:34:ds:45:gd:45             2    actback.csv
                                    awback.csv
DR:45:ds:FR:56:G7             2    actback.csv
                                    awback.csv
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Dec 2015 15:50:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-one-table-by-combining-a-common-field-with/m-p/245757#M73269</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-12-02T15:50:15Z</dc:date>
    </item>
  </channel>
</rss>

