<?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 combine common fields in 2 sourcetypes without using the join command? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-combine-common-fields-in-2-sourcetypes-without-using-the/m-p/297920#M56375</link>
    <description>&lt;P&gt;Thank you cmerriman for replying.&lt;BR /&gt;
I used a lookup for sourcetypeB to reduce the query size. so the lookup query is like &lt;BR /&gt;
    index=whatever sourcetype=B earliest=-30d@d outputlookup B-lookup&lt;BR /&gt;
Then in the main query I used the inputlookup for finding UserName in B&lt;/P&gt;

&lt;P&gt;I also tried the query you mentioned but it only returns values of fields from one of the sourcetype.&lt;BR /&gt;
Maybe I will try to filter out some unnecessary data from the datasets.&lt;/P&gt;</description>
    <pubDate>Fri, 07 Jul 2017 13:04:11 GMT</pubDate>
    <dc:creator>lucky001</dc:creator>
    <dc:date>2017-07-07T13:04:11Z</dc:date>
    <item>
      <title>How to combine common fields in 2 sourcetypes without using the join command?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-combine-common-fields-in-2-sourcetypes-without-using-the/m-p/297918#M56373</link>
      <description>&lt;P&gt;I am using Splunk Enterprise. Here are 2 sourcetype A and B and they share a same fileld UserName. The search time range of A is changeable according to the time picker while the time range of B is &lt;A href="mailto:-30d@d"&gt;-30d@d&lt;/A&gt;. &lt;BR /&gt;
B has less UserName than A (B is a subset of A) and what I want is to use B's UserName and combined with A, then return A's other fields.&lt;/P&gt;

&lt;P&gt;Since both sourcetype A and B are huge. I tried to save source B search with -30d@d in the lookup to make the subsearch quicker. But this search is still about 250-300MB which exceeds the limit which is 200MB. It takes Splunk running forever.&lt;BR /&gt;
The search is like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=whatever sourcetype=A 
|join UserName [inputlookup B-lookup]
|table UserName, "B's fields", "A's fields"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I tried to use stats but did not find a way to do the combination. &lt;/P&gt;

&lt;P&gt;Is there anyone that could help with doing the combination without using &lt;CODE&gt;join&lt;/CODE&gt;? Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 19:13:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-combine-common-fields-in-2-sourcetypes-without-using-the/m-p/297918#M56373</guid>
      <dc:creator>lucky001</dc:creator>
      <dc:date>2017-07-06T19:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine common fields in 2 sourcetypes without using the join command?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-combine-common-fields-in-2-sourcetypes-without-using-the/m-p/297919#M56374</link>
      <description>&lt;P&gt;so you do not need the lookup because B is a sourcetype, correct?&lt;/P&gt;

&lt;P&gt;can you try something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=whatever sourcetype=A OR (index=whatever sourcetype=B earliest=-30d@d)
|stats values(B fields) values(A fields) by UserName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;edit the stats command as you see fit.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 20:57:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-combine-common-fields-in-2-sourcetypes-without-using-the/m-p/297919#M56374</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-07-06T20:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine common fields in 2 sourcetypes without using the join command?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-combine-common-fields-in-2-sourcetypes-without-using-the/m-p/297920#M56375</link>
      <description>&lt;P&gt;Thank you cmerriman for replying.&lt;BR /&gt;
I used a lookup for sourcetypeB to reduce the query size. so the lookup query is like &lt;BR /&gt;
    index=whatever sourcetype=B earliest=-30d@d outputlookup B-lookup&lt;BR /&gt;
Then in the main query I used the inputlookup for finding UserName in B&lt;/P&gt;

&lt;P&gt;I also tried the query you mentioned but it only returns values of fields from one of the sourcetype.&lt;BR /&gt;
Maybe I will try to filter out some unnecessary data from the datasets.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jul 2017 13:04:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-combine-common-fields-in-2-sourcetypes-without-using-the/m-p/297920#M56375</guid>
      <dc:creator>lucky001</dc:creator>
      <dc:date>2017-07-07T13:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine common fields in 2 sourcetypes without using the join command?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-combine-common-fields-in-2-sourcetypes-without-using-the/m-p/297921#M56376</link>
      <description>&lt;P&gt;solved by using this instead of join with subsearch.&lt;BR /&gt;
    ...&lt;BR /&gt;
    |lookup B-lookup UserName OUTPUT BField&lt;BR /&gt;
    |where isnotnull(BField)&lt;BR /&gt;
    ...&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2017 17:49:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-combine-common-fields-in-2-sourcetypes-without-using-the/m-p/297921#M56376</guid>
      <dc:creator>lucky001</dc:creator>
      <dc:date>2017-07-11T17:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine common fields in 2 sourcetypes without using the join command?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-combine-common-fields-in-2-sourcetypes-without-using-the/m-p/297922#M56377</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;P&gt;index=whatever eventtype=whateversourcetype  |table UserName, "B's fields", "A's fields"&lt;/P&gt;

&lt;P&gt;eventtypes.conf&lt;/P&gt;

&lt;P&gt;[whateversourcetype ]&lt;BR /&gt;
search =  sourcetype=A OR sourcetype=B&lt;/P&gt;

&lt;P&gt;or&lt;BR /&gt;
From GUI:&lt;/P&gt;

&lt;P&gt;settings-&amp;gt;Event types-&amp;gt; new &lt;/P&gt;

&lt;P&gt;Name=whateversourcetype &lt;BR /&gt;
Search String=sourcetype=A OR sourcetype=B&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2017 18:06:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-combine-common-fields-in-2-sourcetypes-without-using-the/m-p/297922#M56377</guid>
      <dc:creator>sbbadri</dc:creator>
      <dc:date>2017-07-11T18:06:32Z</dc:date>
    </item>
  </channel>
</rss>

