<?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 join two searches? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-searches/m-p/412231#M118884</link>
    <description>&lt;P&gt;Hi @Shashank_87,&lt;/P&gt;

&lt;P&gt;Try adding &lt;CODE&gt;format&lt;/CODE&gt; to the subsearch&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="A" sourcetype="test*" requested_content="/index" 
| join uniqueId
[ search [search B|format] ] 
| timechart span=1h count 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also if you have a common unique field, try &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="A" OR index="B"  requested_content="/index"  //Add your common search terms from both searches
|eventstats count(uniqueId)  as dups
|where dups &amp;gt;1
|timechart span=1h count 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If there is only one uniqueId in each event, above result will have duplicates only if its present in both searches and thus we can filter the results which have entries in both searches&lt;BR /&gt;
If the above doesnt work, provide us some sample from both searches&lt;/P&gt;</description>
    <pubDate>Thu, 28 Jun 2018 12:46:19 GMT</pubDate>
    <dc:creator>renjith_nair</dc:creator>
    <dc:date>2018-06-28T12:46:19Z</dc:date>
    <item>
      <title>How to join two searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-searches/m-p/412228#M118881</link>
      <description>&lt;P&gt;Hi, I am trying to join two of my searches in splunk using a common field uniqueID but I am getting a error in Splunk Job inspector - SubSearch produced more than 50k results, truncating to max out 50k.&lt;BR /&gt;
I can't change limits.conf and I have to use the query to get the desired result.&lt;/P&gt;

&lt;P&gt;Really appreciate if someone can help on this? My query is something like this -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="A" sourcetype="test*" requested_content="/index" 
| join uniqueId
    [ search [search B] ] 
| timechart span=1h count 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 Jun 2018 11:35:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-searches/m-p/412228#M118881</guid>
      <dc:creator>Shashank_87</dc:creator>
      <dc:date>2018-06-28T11:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-searches/m-p/412229#M118882</link>
      <description>&lt;P&gt;Hi, there is always a limitation set on the number of rows you can run your join command with,&lt;BR /&gt;
Typically your solunk admin would have set a limit of 50k (we have 25 k) as a threshold.&lt;BR /&gt;
You need to tell us your use case and let us see if we can do this without  a join / join with some trimming.&lt;BR /&gt;
Needless to say, running such a big join will sooner or later give you severe performance issues.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 11:48:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-searches/m-p/412229#M118882</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2018-06-28T11:48:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-searches/m-p/412230#M118883</link>
      <description>&lt;P&gt;so I am looking to get the response time for a particular page. Now that pages comes in both logged in and logged out versions and I am only looking for logged in customers.&lt;BR /&gt;
My search 1 gives the page load time (response_time) of the requested content but it doesn't tell you if it was logged out page or logged in page. My 2nd search gives me the events which will only come in case of Logged in customer.&lt;BR /&gt;
So I need to join two searches on the basis of a common field called uniqueID.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 12:12:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-searches/m-p/412230#M118883</guid>
      <dc:creator>Shashank_87</dc:creator>
      <dc:date>2018-06-28T12:12:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-searches/m-p/412231#M118884</link>
      <description>&lt;P&gt;Hi @Shashank_87,&lt;/P&gt;

&lt;P&gt;Try adding &lt;CODE&gt;format&lt;/CODE&gt; to the subsearch&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="A" sourcetype="test*" requested_content="/index" 
| join uniqueId
[ search [search B|format] ] 
| timechart span=1h count 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also if you have a common unique field, try &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="A" OR index="B"  requested_content="/index"  //Add your common search terms from both searches
|eventstats count(uniqueId)  as dups
|where dups &amp;gt;1
|timechart span=1h count 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If there is only one uniqueId in each event, above result will have duplicates only if its present in both searches and thus we can filter the results which have entries in both searches&lt;BR /&gt;
If the above doesnt work, provide us some sample from both searches&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 12:46:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-searches/m-p/412231#M118884</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-06-28T12:46:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to join two searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-searches/m-p/412232#M118885</link>
      <description>&lt;P&gt;As others have mentioned, this is &lt;EM&gt;exactly&lt;/EM&gt; why &lt;CODE&gt;join&lt;/CODE&gt; should be avoided.  Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index="A" sourcetype="test*" requested_content="/index") OR (search B with uniqueId)
| bin _time span=1h
| stats dc(sourcetype) AS num_sourcetypes values(sourcetype) BY uniqueId _time
| where num_sourcetypes==2 OR Maybe Different Logic HERE
| timechart span=1h count
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 30 Jun 2018 15:21:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-two-searches/m-p/412232#M118885</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-06-30T15:21:50Z</dc:date>
    </item>
  </channel>
</rss>

