<?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 do i correlate events using subsearch from two sources based on two different conditions? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-i-correlate-events-using-subsearch-from-two-sources-based/m-p/508924#M142191</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/223335"&gt;@Sunil2020&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can use subserach in this scenario. Based on the number of events in the subsearch and in the index, you can use one of the below logic that best suits your use case.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;For less number of long running jobs:&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=index_name source="table B" [ search index=index_name source="table A" | (your criteria to get long running job IDs | table jobID | format ] | table JobID, AgentName, JobType, JobDate,JobEndHour  &lt;/LI-CODE&gt;&lt;P&gt;&lt;STRONG&gt;For more/optimal number of long running jobs:&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=index_name source="table B" | table JobID, AgentName, JobType, JobDate,JobEndHour | join type=inner JobID [ search index=index_name source="table A" | (your criteria to get long running job IDs | table jobID ]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; subsearch has limitations both in the number of events (10000 OR 50000 depends on where you use) &amp;amp; run time (60s). when it hits either of this limit, it auto completes the search.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;If you face this scenario, please create a csv file for the long running job IDs and use that in the second example.&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;</description>
    <pubDate>Mon, 13 Jul 2020 21:49:28 GMT</pubDate>
    <dc:creator>anilchaithu</dc:creator>
    <dc:date>2020-07-13T21:49:28Z</dc:date>
    <item>
      <title>How do i correlate events using subsearch from two sources based on two different conditions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-i-correlate-events-using-subsearch-from-two-sources-based/m-p/508693#M142126</link>
      <description>&lt;P&gt;Hello Splunker,&lt;/P&gt;&lt;P&gt;I have a below scenario where i am struggling to come up with search query, and would like to ask your expert advise to achieve the same.&lt;/P&gt;&lt;P&gt;I have two database tables A and B and i have ingested them in two different sources in my splunk instance.&lt;/P&gt;&lt;P&gt;Table A has data related to Job which basically has fields like JobID, JobName, StartTime, EndTime&lt;/P&gt;&lt;P&gt;Table B has data related to Job execution details like JobID, AgentName, JobType, JobDate,JobEndHour&lt;/P&gt;&lt;P&gt;Certain Jobs (Table A) takes longer time to finish and to find out the details in terms of whats was going on during the time Job (Which is taking longer) was running can be found from Table B.&lt;/P&gt;&lt;P&gt;To find data from Table B, First we need to find out which Agent (AgentName) was handling the job (using JobID, StartTime, EndTime) and once we have Agent details, we have to search again in Table B that during those hours (StartTime, EndTime) what other Jobs were handled including Job in question by the Agent.&lt;/P&gt;&lt;P&gt;Both tables has JobID as common field.&lt;/P&gt;&lt;P&gt;Any help or pointers are highly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Sun, 12 Jul 2020 16:45:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-i-correlate-events-using-subsearch-from-two-sources-based/m-p/508693#M142126</guid>
      <dc:creator>Sunil2020</dc:creator>
      <dc:date>2020-07-12T16:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do i correlate events using subsearch from two sources based on two different conditions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-i-correlate-events-using-subsearch-from-two-sources-based/m-p/508924#M142191</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/223335"&gt;@Sunil2020&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can use subserach in this scenario. Based on the number of events in the subsearch and in the index, you can use one of the below logic that best suits your use case.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;For less number of long running jobs:&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=index_name source="table B" [ search index=index_name source="table A" | (your criteria to get long running job IDs | table jobID | format ] | table JobID, AgentName, JobType, JobDate,JobEndHour  &lt;/LI-CODE&gt;&lt;P&gt;&lt;STRONG&gt;For more/optimal number of long running jobs:&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=index_name source="table B" | table JobID, AgentName, JobType, JobDate,JobEndHour | join type=inner JobID [ search index=index_name source="table A" | (your criteria to get long running job IDs | table jobID ]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; subsearch has limitations both in the number of events (10000 OR 50000 depends on where you use) &amp;amp; run time (60s). when it hits either of this limit, it auto completes the search.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;If you face this scenario, please create a csv file for the long running job IDs and use that in the second example.&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2020 21:49:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-i-correlate-events-using-subsearch-from-two-sources-based/m-p/508924#M142191</guid>
      <dc:creator>anilchaithu</dc:creator>
      <dc:date>2020-07-13T21:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do i correlate events using subsearch from two sources based on two different conditions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-i-correlate-events-using-subsearch-from-two-sources-based/m-p/509038#M142222</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/204579"&gt;@anilchaithu&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for response.&lt;/P&gt;&lt;P&gt;Your suggestion certainly gives me the insight into Table B based on value from Table A.&lt;/P&gt;&lt;P&gt;In my scenario, i have to lookup twice into Table B actually. Fist I will have to query Table B with JobID from Table A which gives me Agent Name. Second lookup into Table B is to query using Agent Name, Data and Hours where Hours needs to be taken from Table A record (Start time, End Time).&lt;/P&gt;&lt;P&gt;This search will basically gives me list of events/jobs Agent was working on before Actual Job (Which is delayed).&lt;/P&gt;&lt;P&gt;So for example,&lt;/P&gt;&lt;P&gt;Table A&lt;/P&gt;&lt;P&gt;JobID&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Start Time&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; EndTime&lt;/P&gt;&lt;P&gt;1234&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2020-07-14 10:30:00&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2020-07-14 11:15:15&lt;/P&gt;&lt;P&gt;Table B&lt;/P&gt;&lt;P&gt;AgentName&amp;nbsp; &amp;nbsp; &amp;nbsp; Date&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Hour&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;JobID&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; JobStatus&lt;/P&gt;&lt;P&gt;ABC&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2020--07-14&amp;nbsp; &amp;nbsp; 10&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 42242&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A&lt;/P&gt;&lt;P&gt;XYZ&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2020--07-14&amp;nbsp; &amp;nbsp; 10&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 42212&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A&lt;/P&gt;&lt;P&gt;ABC&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2020--07-14&amp;nbsp; &amp;nbsp; 11&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 42215&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A&lt;/P&gt;&lt;P&gt;RRR&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2020--07-14&amp;nbsp; &amp;nbsp; 10&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 42218&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A&lt;/P&gt;&lt;P&gt;ABC&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2020--07-14&amp;nbsp; &amp;nbsp; 11&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;42213&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A&lt;/P&gt;&lt;P&gt;ABC&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2020--07-14&amp;nbsp; &amp;nbsp; 11&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1234&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A&lt;/P&gt;&lt;P&gt;In above example, JobID 1234 is delayed more than 10 minutes, so when we check Table B for that JobID, we can see Agent ABC has handled that job. Now if we look at Hours (Start Time, End Time) from Table A, it is 10:30 and 11:15 so we have to consider lower and higher side of hours which is 10 and 12.&lt;/P&gt;&lt;P&gt;We now need to query Table B with Agent ABC , Date 2020-07-14 and Hours between 10 to 12 which will give results as below.&lt;/P&gt;&lt;P&gt;AgentName&amp;nbsp; &amp;nbsp; &amp;nbsp; Date&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Hour&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;JobID&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; JobStatus&lt;/P&gt;&lt;P&gt;ABC&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2020--07-14&amp;nbsp; &amp;nbsp; 10&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 42242&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A&lt;/P&gt;&lt;P&gt;ABC&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2020--07-14&amp;nbsp; &amp;nbsp; 11&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 42215&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A&lt;/P&gt;&lt;P&gt;ABC&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2020--07-14&amp;nbsp; &amp;nbsp; 11&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;42213&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A&lt;/P&gt;&lt;P&gt;ABC&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2020--07-14&amp;nbsp; &amp;nbsp; 11&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1234&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A&lt;/P&gt;&lt;P&gt;In above results, i can see my job 1234 executed after 3 other jobs by the Agent ABC. This is the output I am expecting from my search.&lt;/P&gt;&lt;P&gt;Any inputs or help is highly appreiciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2020 10:47:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-i-correlate-events-using-subsearch-from-two-sources-based/m-p/509038#M142222</guid>
      <dc:creator>Sunil2020</dc:creator>
      <dc:date>2020-07-14T10:47:32Z</dc:date>
    </item>
  </channel>
</rss>

