<?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: Find events that occur after  the time returned from a subsearch  for a specific field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Find-events-that-occur-after-the-time-returned-from-a-subsearch/m-p/115280#M30530</link>
    <description>&lt;P&gt;Thank you, This gets me much closer to what I want to do.  The only issue I have now is I have to convert the completed_date to epoch to use it as my comparison value. Dataset2 _time is based off create_date but Dataset1 _time value is not based off of completed_date.&lt;/P&gt;

&lt;P&gt;Thanks again,&lt;BR /&gt;
Paul&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 20:01:50 GMT</pubDate>
    <dc:creator>loeweps</dc:creator>
    <dc:date>2020-09-28T20:01:50Z</dc:date>
    <item>
      <title>Find events that occur after  the time returned from a subsearch  for a specific field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-events-that-occur-after-the-time-returned-from-a-subsearch/m-p/115278#M30528</link>
      <description>&lt;P&gt;I have two sets of data.  Both have account number and date along with a list of other fields. I want to search for account numbers in dataset 1 and take those account number and find all records that occur after the event for each account number. &lt;/P&gt;

&lt;P&gt;I assume a subsearch is the best way to do that. &lt;/P&gt;

&lt;P&gt;If I have &lt;BR /&gt;
Dataset1:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Account_Num      Complete_Date
1                 1/5/2015
2                 2/3/2015
3                 2/6/2015
1                 2/9/2015
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Dataset2: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Account       Create_Date
1               1/1/2015
2               2/6/2015
3               2/8/2015
1               2/14/2015
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to search for and return the account number and completed date and then search the second data set for accounts with a created date of within 14 days of the date from the first search. &lt;/P&gt;

&lt;P&gt;I was assuming that I should do a subsearch that would return the &lt;CODE&gt;Account_Num&lt;/CODE&gt; and &lt;CODE&gt;Complete_Date&lt;/CODE&gt; but I am not sure of the best way to have it only search on the &lt;CODE&gt;Account_Num&lt;/CODE&gt; and then search within a 14 day window of the &lt;CODE&gt;Complete_Date&lt;/CODE&gt; against the &lt;CODE&gt;Create_Date&lt;/CODE&gt;.  I looked up foreach but wasn't sure if that solves my issue. &lt;/P&gt;

&lt;P&gt;I want it to return only the three records listed below from Dataset2 because they have a matching account number and have a create date of within 14 days of the data from Dataset1&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Account       Create_Date
2               2/6/2015
3               2/8/2015
1               2/14/2015
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks in advance for any help with this as it is appreciated. &lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2015 18:04:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-events-that-occur-after-the-time-returned-from-a-subsearch/m-p/115278#M30528</guid>
      <dc:creator>loeweps</dc:creator>
      <dc:date>2015-05-20T18:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: Find events that occur after  the time returned from a subsearch  for a specific field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-events-that-occur-after-the-time-returned-from-a-subsearch/m-p/115279#M30529</link>
      <description>&lt;P&gt;Try to avoid subsearches whenever possible.  Try this (assuming you are timestamping the events based on the date field values within the events):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=Dataset1 | stats first(_time) AS latestTime by Account_Num | map search="sourcetype=Dataset2 Account=$Account_Num$ | eval delta=_time - $latestTime$ | where abs(delta)&amp;lt;1209600"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 May 2015 20:36:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-events-that-occur-after-the-time-returned-from-a-subsearch/m-p/115279#M30529</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-05-20T20:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: Find events that occur after  the time returned from a subsearch  for a specific field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-events-that-occur-after-the-time-returned-from-a-subsearch/m-p/115280#M30530</link>
      <description>&lt;P&gt;Thank you, This gets me much closer to what I want to do.  The only issue I have now is I have to convert the completed_date to epoch to use it as my comparison value. Dataset2 _time is based off create_date but Dataset1 _time value is not based off of completed_date.&lt;/P&gt;

&lt;P&gt;Thanks again,&lt;BR /&gt;
Paul&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 20:01:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-events-that-occur-after-the-time-returned-from-a-subsearch/m-p/115280#M30530</guid>
      <dc:creator>loeweps</dc:creator>
      <dc:date>2020-09-28T20:01:50Z</dc:date>
    </item>
  </channel>
</rss>

