<?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 limit primary search based on time interval from subsearch -- dynamic time interval ; time delta in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-primary-search-based-on-time-interval-from/m-p/79363#M20086</link>
    <description>&lt;P&gt;In order to query from an external firewall log that contains say "badwebsite.com" and join those results back through the internal firewall's NAT translation and ultimately join the internal 10. address back to DHCP I need to limit the external search to _time plus or minus ~5 minutes.&lt;/P&gt;

&lt;P&gt;In an ideal world a feature enhancement would be added to the main search / join commands that would look like:&lt;/P&gt;

&lt;P&gt;search sourcetype=dhcp -timedelta -+5m | join [search sourcetype=ext_fw badwebsite.com]&lt;/P&gt;

&lt;P&gt;I have looked at using | eval to generate begin and end variables... but I cannot figure out how to do this elegantly.  Help or votes for an enhancement would be greatly appreciated!&lt;/P&gt;</description>
    <pubDate>Wed, 02 Oct 2013 02:45:49 GMT</pubDate>
    <dc:creator>TobiasBoone</dc:creator>
    <dc:date>2013-10-02T02:45:49Z</dc:date>
    <item>
      <title>How to limit primary search based on time interval from subsearch -- dynamic time interval ; time delta</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-primary-search-based-on-time-interval-from/m-p/79363#M20086</link>
      <description>&lt;P&gt;In order to query from an external firewall log that contains say "badwebsite.com" and join those results back through the internal firewall's NAT translation and ultimately join the internal 10. address back to DHCP I need to limit the external search to _time plus or minus ~5 minutes.&lt;/P&gt;

&lt;P&gt;In an ideal world a feature enhancement would be added to the main search / join commands that would look like:&lt;/P&gt;

&lt;P&gt;search sourcetype=dhcp -timedelta -+5m | join [search sourcetype=ext_fw badwebsite.com]&lt;/P&gt;

&lt;P&gt;I have looked at using | eval to generate begin and end variables... but I cannot figure out how to do this elegantly.  Help or votes for an enhancement would be greatly appreciated!&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2013 02:45:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-primary-search-based-on-time-interval-from/m-p/79363#M20086</guid>
      <dc:creator>TobiasBoone</dc:creator>
      <dc:date>2013-10-02T02:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit primary search based on time interval from subsearch -- dynamic time interval ; time delta</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-primary-search-based-on-time-interval-from/m-p/79364#M20087</link>
      <description>&lt;P&gt;You can try the following method:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;Have your subsearch find the latest event that you want to search around&lt;/LI&gt;
&lt;LI&gt;Still in the subsearch, calculate the &lt;CODE&gt;earliest&lt;/CODE&gt; and &lt;CODE&gt;latest&lt;/CODE&gt; time boundaries you would like to use for the outer search based on the _time of that event&lt;/LI&gt;
&lt;LI&gt;Have the subsearch return &lt;CODE&gt;earliest&lt;/CODE&gt; and &lt;CODE&gt;latest&lt;/CODE&gt; to the outer search&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Here's an example showing how to retrieve a window of +/- 60s worth of events around the latest splunkd restart:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal source=*splunkd.log [
  search index=_internal "Splunkd starting"
  | head 1
  | eval earliest = _time - 60
  | eval latest = _time + 60
  | return earliest latest]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Oct 2013 14:59:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-primary-search-based-on-time-interval-from/m-p/79364#M20087</guid>
      <dc:creator>hexx</dc:creator>
      <dc:date>2013-10-02T14:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit primary search based on time interval from subsearch -- dynamic time interval ; time delta</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-primary-search-based-on-time-interval-from/m-p/79365#M20088</link>
      <description>&lt;P&gt;I see where your thought process is; perhaps my question wasn't quite specific enough.  Correct me if I am wrong but this looks like it would return results based off of 1 time interval.  What I am looking to do is recurse through multiple items as I would through piping and get multiple time intervals returned.  Ie:&lt;/P&gt;

&lt;P&gt;index=main sourcetype=dhcp  | join dhcp_ip [search index=ext_fw badsite.com earliest=-30d | rename ext_fw_url_cip as dhcp_ip | head 1  | eval earliest = _time - 600  | eval latest = _time + 600  | return earliest latest]&lt;/P&gt;

&lt;P&gt;This is rather backwards logic because  earliest and latest aren't being kicked back to the outside search in iterations.  Am I missing something blatant? &lt;/P&gt;

&lt;P&gt;I am so close to a working solution I just about can't stand it, but close only counts in horseshoes and hand grenades.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:52:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-primary-search-based-on-time-interval-from/m-p/79365#M20088</guid>
      <dc:creator>TobiasBoone</dc:creator>
      <dc:date>2020-09-28T14:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit primary search based on time interval from subsearch -- dynamic time interval ; time delta</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-primary-search-based-on-time-interval-from/m-p/79366#M20089</link>
      <description>&lt;P&gt;This example specifically hopes to see  who hit a site over the past 30 days, then based on that time interval +-10 minutes determine who had the IP leased from DHCP.  This example modified slightly works great for nat/pat translations because the permutation of IP and Port don't over lap that much.  With non natted networks however and 5 minute DHCP lease times with 22 thousand mobile devices the same person rarely has the same IP for more than a few minutes.  The time delta is a crucial element in doing the join.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2013 21:40:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-primary-search-based-on-time-interval-from/m-p/79366#M20089</guid>
      <dc:creator>TobiasBoone</dc:creator>
      <dc:date>2013-10-02T21:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit primary search based on time interval from subsearch -- dynamic time interval ; time delta</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-primary-search-based-on-time-interval-from/m-p/79367#M20090</link>
      <description>&lt;P&gt;The outer search will only take &lt;EM&gt;one&lt;/EM&gt; value for &lt;CODE&gt;earliest&lt;/CODE&gt; and &lt;CODE&gt;latest&lt;/CODE&gt; each, so to fulfill your request, a different approach will be necessary. I'm not quite sure if that is feasible with the search operators that are built-in today. You may need to write your own Python search command to iterate over the results of the subsearch and restrict the events returned by the outer search to corresponding pockets of time.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2013 22:20:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-primary-search-based-on-time-interval-from/m-p/79367#M20090</guid>
      <dc:creator>hexx</dc:creator>
      <dc:date>2013-10-02T22:20:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit primary search based on time interval from subsearch -- dynamic time interval ; time delta</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-primary-search-based-on-time-interval-from/m-p/79368#M20091</link>
      <description>&lt;P&gt;This is highly unfortunate.  This type of iterative subsearch is necessary on so many levels for us; but writing python at the moment isn't in the cards.&lt;BR /&gt;&lt;BR /&gt;
RIAA/MPAA complaints&lt;BR /&gt;
Tracking down botnets&lt;BR /&gt;
Usage statists to the actual internal user&lt;BR /&gt;
Appropriate use investigations&lt;BR /&gt;
Wireless Access Point Utilization&lt;BR /&gt;
802.1x supplicant tracking by errored machines&lt;/P&gt;

&lt;P&gt;All of these things require finding a set of results and then correlating each of them to their respective set of sub data on or about that moment in time.&lt;/P&gt;

&lt;P&gt;Please let me know&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2013 21:23:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-primary-search-based-on-time-interval-from/m-p/79368#M20091</guid>
      <dc:creator>TobiasBoone</dc:creator>
      <dc:date>2013-10-03T21:23:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit primary search based on time interval from subsearch -- dynamic time interval ; time delta</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-primary-search-based-on-time-interval-from/m-p/79369#M20092</link>
      <description>&lt;P&gt;Another possibility might be to implement this as a view workflow:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;A first panel would be driven by a search listing all anomalous events and present them as a table, one anomaly per row.&lt;/LI&gt;
&lt;LI&gt;An in-view drilldown is available when the user clicks on one of the anomalous results, populating a secondary panel showing the events surrounding the anomaly.&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;We use such a workflow in the "Crashes" view of the &lt;A href="http://www.splunk.com/goto/sos"&gt;S.o.S app&lt;/A&gt;, if you'd like to see an example.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2013 21:40:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-primary-search-based-on-time-interval-from/m-p/79369#M20092</guid>
      <dc:creator>hexx</dc:creator>
      <dc:date>2013-10-03T21:40:50Z</dc:date>
    </item>
  </channel>
</rss>

