<?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 search millions of events between two sourcetypes based on common/matching criteria? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-millions-of-events-between-two-sourcetypes-based/m-p/215755#M63270</link>
    <description>&lt;P&gt;I have tried the following search, but it doesn't work correctly.&lt;/P&gt;

&lt;P&gt;Option 1) Using following join command, it works great for 1Hr of window. But when increasing the window, it starts giving me incomplete/partial results as it's scanning millions of events for 24hr of duration.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=sl_logs sourcetype=sl_myworld | Join a_xf_BestSessionID [search index=teb x_EventID=10577 DISPLAYCODE=SVCMS03 | rename x_BESTSessionID as a_xf_BestSessionID | table a_xf_BestSessionID ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Option 2) I have created following different search referring to the post &lt;A href="https://answers.splunk.com/answers/129424/how-to-compare-fields-over-multiple-sourcetypes-without-join-append-or-use-of-subsearches.html"&gt;https://answers.splunk.com/answers/129424/how-to-compare-fields-over-multiple-sourcetypes-without-join-append-or-use-of-subsearches.html&lt;/A&gt;&lt;BR /&gt;
These searches returns all the x_BESTSessionID which are result of &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=teb sourcetype=tealeaf_eventbus x_EventID=10577 DISPLAYCODE=SVCMS03
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, it lists all events from &lt;CODE&gt;index=sl_logs sourcetype=sl_myworld&lt;/CODE&gt;, and there is not filtering done based on the command &lt;CODE&gt;where tealeaf_eventbus=sl_myworld&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;1st search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=teb sourcetype=tealeaf_eventbus x_EventID=10577 DISPLAYCODE=SVCMS03) OR (index=sl_logs sourcetype=sl_myworld)
| eval Test-{sourcetype}=a_xf_BestSessionID
| stats values(Test-*) AS *
| mvexpand tealeaf_eventbus
| mvexpand sl_myworld
| where tealeaf_eventbus=sl_myworld
| rename sl_myworld AS a_xf_BestSessionID
| fields -tealeaf_eventbus
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;2nd search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=teb sourcetype=tealeaf_eventbus x_EventID=10577 DISPLAYCODE=SVCMS03) OR (index=sl_logs sourcetype=sl_myworld)
| eval Test-{sourcetype}=x_BESTSessionID
| stats values(Test-*) AS *
| mvexpand tealeaf_eventbus
| mvexpand sl_myworld
| where tealeaf_eventbus=sl_myworld
| rename sl_myworld AS x_BESTSessionID
| fields -tealeaf_eventbus
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;3rd search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=teb sourcetype=tealeaf_eventbus x_EventID=10577 DISPLAYCODE=SVCMS03 | rename x_BESTSessionID AS a_xf_BestSessionID) OR (index=sl_logs sourcetype=sl_myworld)
| eval Test-{sourcetype}=a_xf_BestSessionID
| stats values(Test-*) AS *
| mvexpand tealeaf_eventbus
| mvexpand sl_myworld
| where tealeaf_eventbus=sl_myworld
| fields -tealeaf_eventbus
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Gives me error:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Error in 'search' command: Unable to parse the search: unbalanced parentheses.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Really appreciate your feedback.&lt;/P&gt;</description>
    <pubDate>Mon, 08 Aug 2016 20:30:28 GMT</pubDate>
    <dc:creator>pradjswl</dc:creator>
    <dc:date>2016-08-08T20:30:28Z</dc:date>
    <item>
      <title>How to search millions of events between two sourcetypes based on common/matching criteria?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-millions-of-events-between-two-sourcetypes-based/m-p/215755#M63270</link>
      <description>&lt;P&gt;I have tried the following search, but it doesn't work correctly.&lt;/P&gt;

&lt;P&gt;Option 1) Using following join command, it works great for 1Hr of window. But when increasing the window, it starts giving me incomplete/partial results as it's scanning millions of events for 24hr of duration.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=sl_logs sourcetype=sl_myworld | Join a_xf_BestSessionID [search index=teb x_EventID=10577 DISPLAYCODE=SVCMS03 | rename x_BESTSessionID as a_xf_BestSessionID | table a_xf_BestSessionID ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Option 2) I have created following different search referring to the post &lt;A href="https://answers.splunk.com/answers/129424/how-to-compare-fields-over-multiple-sourcetypes-without-join-append-or-use-of-subsearches.html"&gt;https://answers.splunk.com/answers/129424/how-to-compare-fields-over-multiple-sourcetypes-without-join-append-or-use-of-subsearches.html&lt;/A&gt;&lt;BR /&gt;
These searches returns all the x_BESTSessionID which are result of &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=teb sourcetype=tealeaf_eventbus x_EventID=10577 DISPLAYCODE=SVCMS03
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, it lists all events from &lt;CODE&gt;index=sl_logs sourcetype=sl_myworld&lt;/CODE&gt;, and there is not filtering done based on the command &lt;CODE&gt;where tealeaf_eventbus=sl_myworld&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;1st search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=teb sourcetype=tealeaf_eventbus x_EventID=10577 DISPLAYCODE=SVCMS03) OR (index=sl_logs sourcetype=sl_myworld)
| eval Test-{sourcetype}=a_xf_BestSessionID
| stats values(Test-*) AS *
| mvexpand tealeaf_eventbus
| mvexpand sl_myworld
| where tealeaf_eventbus=sl_myworld
| rename sl_myworld AS a_xf_BestSessionID
| fields -tealeaf_eventbus
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;2nd search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=teb sourcetype=tealeaf_eventbus x_EventID=10577 DISPLAYCODE=SVCMS03) OR (index=sl_logs sourcetype=sl_myworld)
| eval Test-{sourcetype}=x_BESTSessionID
| stats values(Test-*) AS *
| mvexpand tealeaf_eventbus
| mvexpand sl_myworld
| where tealeaf_eventbus=sl_myworld
| rename sl_myworld AS x_BESTSessionID
| fields -tealeaf_eventbus
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;3rd search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=teb sourcetype=tealeaf_eventbus x_EventID=10577 DISPLAYCODE=SVCMS03 | rename x_BESTSessionID AS a_xf_BestSessionID) OR (index=sl_logs sourcetype=sl_myworld)
| eval Test-{sourcetype}=a_xf_BestSessionID
| stats values(Test-*) AS *
| mvexpand tealeaf_eventbus
| mvexpand sl_myworld
| where tealeaf_eventbus=sl_myworld
| fields -tealeaf_eventbus
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Gives me error:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Error in 'search' command: Unable to parse the search: unbalanced parentheses.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Really appreciate your feedback.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2016 20:30:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-millions-of-events-between-two-sourcetypes-based/m-p/215755#M63270</guid>
      <dc:creator>pradjswl</dc:creator>
      <dc:date>2016-08-08T20:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to search millions of events between two sourcetypes based on common/matching criteria?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-millions-of-events-between-two-sourcetypes-based/m-p/215756#M63271</link>
      <description>&lt;P&gt;How about this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=teb sourcetype=tealeaf_eventbus x_EventID=10577 DISPLAYCODE=SVCMS03) OR (index=sl_logs sourcetype=sl_myworld)
| stats dc(sourcetype) as sts by a_xf_BestSessionID | where sts=2 | fields - sts
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Aug 2016 21:39:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-millions-of-events-between-two-sourcetypes-based/m-p/215756#M63271</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-08-08T21:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to search millions of events between two sourcetypes based on common/matching criteria?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-millions-of-events-between-two-sourcetypes-based/m-p/215757#M63272</link>
      <description>&lt;P&gt;Hi pradjswl,&lt;/P&gt;

&lt;P&gt;Regarding 3rd search; there is and error in &lt;BR /&gt;
&lt;CODE&gt;(index=teb sourcetype=tealeaf_eventbus x_EventID=10577 DISPLAYCODE=SVCMS03 | rename x_BESTSessionID AS a_xf_BestSessionID) OR (index=sl_logs sourcetype=sl_myworld)&lt;/CODE&gt; &lt;BR /&gt;
could this be more like &lt;BR /&gt;
&lt;CODE&gt;(index=teb sourcetype=tealeaf_eventbus x_EventID=10577 DISPLAYCODE=SVCMS03) OR (index=sl_logs sourcetype=sl_myworld) | rename x_BESTSessionID AS a_xf_BestSessionID&lt;/CODE&gt; ?&lt;/P&gt;

&lt;P&gt;Regarding 1st and 2nd searches; try to remove everything after the first &lt;CODE&gt;stats&lt;/CODE&gt; - if the events do make sense add &lt;STRONG&gt;ONE&lt;/STRONG&gt; additional step in the search pipe and re-check the events... continue until it breaks and you have the step in the search pipe which needs to be fixed.&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2016 21:41:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-millions-of-events-between-two-sourcetypes-based/m-p/215757#M63272</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2016-08-08T21:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to search millions of events between two sourcetypes based on common/matching criteria?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-millions-of-events-between-two-sourcetypes-based/m-p/215758#M63273</link>
      <description>&lt;P&gt;Great thanks @samesoni2 for quick response, I tried the query you shared, unfortunately ts returning all the events from sl_myworld. &lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2016 21:45:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-millions-of-events-between-two-sourcetypes-based/m-p/215758#M63273</guid>
      <dc:creator>pradjswl</dc:creator>
      <dc:date>2016-08-08T21:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to search millions of events between two sourcetypes based on common/matching criteria?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-millions-of-events-between-two-sourcetypes-based/m-p/215759#M63274</link>
      <description>&lt;P&gt;Hey Mus - Great thanks for correction. I tried following query&lt;BR /&gt;
(index=teb sourcetype=tealeaf_eventbus x_EventID=10577 DISPLAYCODE=SVCMS03) OR (index=sl_logs sourcetype=sl_myworld) | rename x_BESTSessionID AS a_xf_BestSessionID | eval Test-{sourcetype}=a_xf_BestSessionID&lt;BR /&gt;
| stats values(Test-*) AS *&lt;BR /&gt;
| mvexpand tealeaf_eventbus&lt;BR /&gt;
| mvexpand sl_myworld&lt;BR /&gt;
| where tealeaf_eventbus=sl_myworld&lt;/P&gt;

&lt;P&gt;In stats tab it give me list of xf_BestSessionID whichc matches with x_BESTSessionID, However Event tab is listing all the event. How do i make sure that Event tab only display those event which are same as the one listed in Stats tab.&lt;BR /&gt;
Ps : Query is not yet in finalized status, almost 15% completed. However displaying all the events in Event tab wont server a purpose for me, as I wanted to slice/dice &amp;amp; make analysis by viewing the values of fields in verbose mode.&lt;/P&gt;

&lt;P&gt;I feel that Event tab is displaying all events from (index=sl_logs sourcetype=sl_myworld) &amp;amp; its not comparing /where tealeaf_eventbus=sl_myworld/ which was technically suppose to work as /a_xf_BestSessionID=x_BESTSessionID/&lt;/P&gt;

&lt;P&gt;Is there a way we can setup a meetup or screen share to walk through it, if thats not too much to ask for. Its not very urgent now &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:32:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-millions-of-events-between-two-sourcetypes-based/m-p/215759#M63274</guid>
      <dc:creator>pradjswl</dc:creator>
      <dc:date>2020-09-29T10:32:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to search millions of events between two sourcetypes based on common/matching criteria?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-millions-of-events-between-two-sourcetypes-based/m-p/215760#M63275</link>
      <description>&lt;P&gt;I accidentally deleted my previous comment.&lt;/P&gt;

&lt;P&gt;Great thank you &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/2012"&gt;@MuS&lt;/a&gt; for the correction in 3rd query.&lt;/P&gt;

&lt;P&gt;I feel that Event tab is displaying all events from (index=sl_logs sourcetype=sl_myworld) returning thousands of event &amp;amp; its not comparing /where tealeaf_eventbus=sl_myworld/ which was technically suppose to work as /a_xf_BestSessionID=x_BESTSessionID/ returning around 50-100s of event.&lt;/P&gt;

&lt;P&gt;In other word I am looking for join between two sourcetype and display only those event which having matching field value.(sourcetype=sl_myworld-&amp;gt; Field=a_xf_BestSessionID &amp;amp; sourcetype=tealeaf_eventbus-&amp;gt;Field=x_BESTSessionID)&lt;/P&gt;

&lt;P&gt;If thats not too much to ask, Is there away I can setup a meeting to walk you through my splunk screen ?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:32:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-millions-of-events-between-two-sourcetypes-based/m-p/215760#M63275</guid>
      <dc:creator>pradjswl</dc:creator>
      <dc:date>2020-09-29T10:32:31Z</dc:date>
    </item>
  </channel>
</rss>

