<?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 How to join two sources based on two search fields? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-sources-based-on-two-search-fields/m-p/255300#M76453</link>
    <description>&lt;P&gt;I have two sets of data:&lt;BR /&gt;
 1. sourcetype=app "DEBUG A" function=UpdateCartItemStatus status=Rejected&lt;BR /&gt;
 2. sourcetype=app "DEBUG B" function=UpdateCartItemStatus&lt;/P&gt;

&lt;P&gt;Set 1 (DEBUG A) also has the fields unitID1, unitID2, and user1&lt;BR /&gt;
Set 2 (DEBUG B) also has the fields unitID1, unitID2, and user2&lt;/P&gt;

&lt;P&gt;I would like to join data set 1 with data set 2 on unitID1 and unitID2 and get a count of the number of instances this occurs per user2. Ideally this would be as efficient as possible as the data sources are large, searches can span long periods of time, and they are constantly being refreshed. A join is not required, it was just the first thing I thought of. &lt;/P&gt;

&lt;P&gt;I am using the dashboard editor for Splunk Enterprise. &lt;/P&gt;</description>
    <pubDate>Wed, 02 Dec 2015 19:14:22 GMT</pubDate>
    <dc:creator>vmnguyen</dc:creator>
    <dc:date>2015-12-02T19:14:22Z</dc:date>
    <item>
      <title>How to join two sources based on two search fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-sources-based-on-two-search-fields/m-p/255300#M76453</link>
      <description>&lt;P&gt;I have two sets of data:&lt;BR /&gt;
 1. sourcetype=app "DEBUG A" function=UpdateCartItemStatus status=Rejected&lt;BR /&gt;
 2. sourcetype=app "DEBUG B" function=UpdateCartItemStatus&lt;/P&gt;

&lt;P&gt;Set 1 (DEBUG A) also has the fields unitID1, unitID2, and user1&lt;BR /&gt;
Set 2 (DEBUG B) also has the fields unitID1, unitID2, and user2&lt;/P&gt;

&lt;P&gt;I would like to join data set 1 with data set 2 on unitID1 and unitID2 and get a count of the number of instances this occurs per user2. Ideally this would be as efficient as possible as the data sources are large, searches can span long periods of time, and they are constantly being refreshed. A join is not required, it was just the first thing I thought of. &lt;/P&gt;

&lt;P&gt;I am using the dashboard editor for Splunk Enterprise. &lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2015 19:14:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-sources-based-on-two-search-fields/m-p/255300#M76453</guid>
      <dc:creator>vmnguyen</dc:creator>
      <dc:date>2015-12-02T19:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two sources based on two search fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-sources-based-on-two-search-fields/m-p/255301#M76454</link>
      <description>&lt;P&gt;Try this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search for set 1 data | eval unit=unitd1."::::".unitd2 | append [search for set 2 data | eval  unit=unitd1."::::".unitd2] | chart limit=0 count by unit over user
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Dec 2015 19:33:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-sources-based-on-two-search-fields/m-p/255301#M76454</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2015-12-02T19:33:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two sources based on two search fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-sources-based-on-two-search-fields/m-p/255302#M76455</link>
      <description>&lt;P&gt;Hm...let me clarify:&lt;/P&gt;

&lt;P&gt;Datapoints:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;sourcetype=app "DEBUG A" function=UpdateCartItemStatus status=Rejected unitID1=1008908999 unitID2 = front user=john&lt;/LI&gt;
&lt;LI&gt;sourcetype=app "DEBUG A" function=UpdateCartItemStatus status=Rejected unitID1=1008908999 unitID2 = back user=john&lt;/LI&gt;
&lt;LI&gt;sourcetype=app "DEBUG B" function=UpdateCartItemStatus status=Printed unitID1=1008908999 unitID2 = front user=mary&lt;/LI&gt;
&lt;LI&gt;sourcetype=app "DEBUG B" function=UpdateCartItemStatus status=Printed unitID1=1008908999 unitID2 = back user=mary&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;I want to count how many times Mary updated the status as "Printed" and DEBUG A reported that it was Rejected. The output should have a count of 2 for user=Mary. &lt;BR /&gt;
Thus, I want to link datapoint 3 to datapoint 1 on and datapoint 4 to datapoint 2 using unitID1 and unitID2. &lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2015 21:02:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-sources-based-on-two-search-fields/m-p/255302#M76455</guid>
      <dc:creator>vmnguyen</dc:creator>
      <dc:date>2015-12-02T21:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two sources based on two search fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-sources-based-on-two-search-fields/m-p/255303#M76456</link>
      <description>&lt;P&gt;will the &lt;CODE&gt;unitid&lt;/CODE&gt; be the same for all (1008908999). how did you know that 3 should be liked to 1?&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2015 21:24:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-sources-based-on-two-search-fields/m-p/255303#M76456</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2015-12-02T21:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two sources based on two search fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-sources-based-on-two-search-fields/m-p/255304#M76457</link>
      <description>&lt;P&gt;Yes, all four of those datapoints would have the same unitID1, but there are millions of datapoints with different unitIDs. We know 3 should be linked to 1 because they share the same unitID1 and unitID2. &lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2015 21:34:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-sources-based-on-two-search-fields/m-p/255304#M76457</guid>
      <dc:creator>vmnguyen</dc:creator>
      <dc:date>2015-12-02T21:34:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two sources based on two search fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-sources-based-on-two-search-fields/m-p/255305#M76458</link>
      <description>&lt;P&gt;How about this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search to get all data using append | transaction unitID2 unitID1 startswith="debug=A" endswith="debug=B" maxevents=2 keepevicted=f
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The &lt;CODE&gt;transaction&lt;/CODE&gt; command has a few more options you can explore&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2015 21:36:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-sources-based-on-two-search-fields/m-p/255305#M76458</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2015-12-02T21:36:42Z</dc:date>
    </item>
  </channel>
</rss>

