<?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 link fields with different names across sources? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-link-fields-with-different-names-across-sources/m-p/274886#M52736</link>
    <description>&lt;P&gt;For the short version, check out this excellent post by @MuS at &lt;A href="http://answers.splunk.com/answers/129424/how-to-compare-fields-over-multiple-sourcetypes-without-join-append-or-use-of-subsearches.html"&gt;http://answers.splunk.com/answers/129424/how-to-compare-fields-over-multiple-sourcetypes-without-join-append-or-use-of-subsearches.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;For the long version, check out this excellent talk by @sideview at &lt;A href="http://wiki.splunk.com/Virtual_.conf"&gt;http://wiki.splunk.com/Virtual_.conf&lt;/A&gt; (March 2016).&lt;/P&gt;

&lt;P&gt;In your example case, you'd do something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search for datasource1 OR datasource2 | stats values(Msg) as Msg values(PromoRcvd) as PromoRcvd sum(SALE) by UID
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The variations are endless.&lt;/P&gt;</description>
    <pubDate>Mon, 04 Apr 2016 23:22:12 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2016-04-04T23:22:12Z</dc:date>
    <item>
      <title>How to link fields with different names across sources?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-link-fields-with-different-names-across-sources/m-p/274885#M52735</link>
      <description>&lt;P&gt;I have two types of transactions, one coming from a mobile app when a push notification is sent, looks approx like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TIMESTAMP="2016-03-29 23:39:01" DDSDKAppEventPushNotificationDelivered Msg=536 UID=101053 DEVICE=galaxys6 IP=XXX
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and events from a shopping cart system, where that user has placed an order, that look approx like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;04/04/2016:15:26:15 TRANSPAYMENT SYSTEM=DD LABEL=1 MERCHANTID=XXX REGISTER=1 LOGIN=125451 TICKET=XXX PAID=YES PAYMETHOD=GIFTCARD CUSTLOYALTY=101053 ITEMS=1 SALE=2.73 DISCTYPE=FLAT DISCAMT=0.0 DISCAPPLIED=0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The &lt;STRONG&gt;CUSTLOYALTY&lt;/STRONG&gt; field in the shopping cart is the same data as the &lt;STRONG&gt;UID&lt;/STRONG&gt; field from the push notifications (if this was a SQL database, I would join tables on those fields).  I have created a field alias for those two fields, "CUSTLOYALTY AS UID".&lt;/P&gt;

&lt;P&gt;I've got some simple logic to separate the customers that received a push notification, coming from the mobile app log:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval PromoRcvd = if (Msg&amp;gt;1,"Yes","No")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But when I try to mix fields from the mobile app log and the shopping cart log, the shopping cart fields (in this case, &lt;STRONG&gt;SALE&lt;/STRONG&gt;) are always empty:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;table UID,Msg,PromoRcvd,sum(SALE)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I thought I didn't need to explicitly join sources in Splunk in order to search across them?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2016 22:53:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-link-fields-with-different-names-across-sources/m-p/274885#M52735</guid>
      <dc:creator>bnash_splunk</dc:creator>
      <dc:date>2016-04-04T22:53:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to link fields with different names across sources?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-link-fields-with-different-names-across-sources/m-p/274886#M52736</link>
      <description>&lt;P&gt;For the short version, check out this excellent post by @MuS at &lt;A href="http://answers.splunk.com/answers/129424/how-to-compare-fields-over-multiple-sourcetypes-without-join-append-or-use-of-subsearches.html"&gt;http://answers.splunk.com/answers/129424/how-to-compare-fields-over-multiple-sourcetypes-without-join-append-or-use-of-subsearches.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;For the long version, check out this excellent talk by @sideview at &lt;A href="http://wiki.splunk.com/Virtual_.conf"&gt;http://wiki.splunk.com/Virtual_.conf&lt;/A&gt; (March 2016).&lt;/P&gt;

&lt;P&gt;In your example case, you'd do something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search for datasource1 OR datasource2 | stats values(Msg) as Msg values(PromoRcvd) as PromoRcvd sum(SALE) by UID
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The variations are endless.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2016 23:22:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-link-fields-with-different-names-across-sources/m-p/274886#M52736</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-04-04T23:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to link fields with different names across sources?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-link-fields-with-different-names-across-sources/m-p/274887#M52737</link>
      <description>&lt;P&gt;Hi bnash [Splunk],&lt;/P&gt;

&lt;P&gt;use &lt;CODE&gt;stats&lt;/CODE&gt; instead of table:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; your base search to get all the events 
 | eval PromoRcvd = if (Msg&amp;gt;1,"Yes","No")
 | stats sum(SALE) AS SALE by UID, Msg, PromoRcvd
&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>Mon, 04 Apr 2016 23:24:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-link-fields-with-different-names-across-sources/m-p/274887#M52737</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2016-04-04T23:24:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to link fields with different names across sources?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-link-fields-with-different-names-across-sources/m-p/274888#M52738</link>
      <description>&lt;P&gt;That still leaves the SALE field blank:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=pos OR index=mobileapp | eval PromoRcvd = if (Msg&amp;gt;1,"Yes","No") | stats sum(SALE) AS SALE by UID, Msg, PromoRcvd
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="https://www.dropbox.com/s/lxmkqtys6lf7fkp/Screenshot%202016-04-04%2016.42.33.png?dl=0"&gt;https://www.dropbox.com/s/lxmkqtys6lf7fkp/Screenshot%202016-04-04%2016.42.33.png?dl=0&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Did I do something wrong?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2016 23:42:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-link-fields-with-different-names-across-sources/m-p/274888#M52738</guid>
      <dc:creator>bnash_splunk</dc:creator>
      <dc:date>2016-04-04T23:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to link fields with different names across sources?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-link-fields-with-different-names-across-sources/m-p/274889#M52739</link>
      <description>&lt;P&gt;Ok, that does some weird things in the results table but it does look like it linked the fields correctly.  But I think it's also creating duplicates in the results?&lt;/P&gt;

&lt;P&gt;&lt;A href="https://www.dropbox.com/s/l4oghy8kdt3bsch/Screenshot%202016-04-04%2016.43.39.png?dl=0"&gt;https://www.dropbox.com/s/l4oghy8kdt3bsch/Screenshot%202016-04-04%2016.43.39.png?dl=0&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2016 23:44:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-link-fields-with-different-names-across-sources/m-p/274889#M52739</guid>
      <dc:creator>bnash_splunk</dc:creator>
      <dc:date>2016-04-04T23:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to link fields with different names across sources?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-link-fields-with-different-names-across-sources/m-p/274890#M52740</link>
      <description>&lt;P&gt;Each UID is listed once, looks fine to me.&lt;/P&gt;

&lt;P&gt;If you're referring to the Yes-No-mv-field, I guess there are events for those UIDs with both Yes and No values. What that means depends on your data and requirements.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2016 23:46:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-link-fields-with-different-names-across-sources/m-p/274890#M52740</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-04-04T23:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to link fields with different names across sources?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-link-fields-with-different-names-across-sources/m-p/274891#M52741</link>
      <description>&lt;P&gt;Can you provide some examples for @martin_mueller and I - please ?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2016 23:46:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-link-fields-with-different-names-across-sources/m-p/274891#M52741</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2016-04-04T23:46:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to link fields with different names across sources?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-link-fields-with-different-names-across-sources/m-p/274892#M52742</link>
      <description>&lt;P&gt;Sure thing - examples of what?  What data do you need?&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2016 00:08:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-link-fields-with-different-names-across-sources/m-p/274892#M52742</guid>
      <dc:creator>bnash_splunk</dc:creator>
      <dc:date>2016-04-05T00:08:34Z</dc:date>
    </item>
  </channel>
</rss>

