<?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 write a search to find hosts that perform web requests to the same site/url at an exact interval? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-find-hosts-that-perform-web-requests-to/m-p/151773#M42492</link>
    <description>&lt;P&gt;thanks a lot, looks promising, will give that a go tomorrow. &lt;BR /&gt;
 could i increase the window to a lot more than 2? ( as 2 will give me loads of results where something more like 10-15 will really filter it down to what i am looking for )&lt;/P&gt;</description>
    <pubDate>Mon, 20 Apr 2015 19:39:08 GMT</pubDate>
    <dc:creator>ng87</dc:creator>
    <dc:date>2015-04-20T19:39:08Z</dc:date>
    <item>
      <title>How to write a search to find hosts that perform web requests to the same site/url at an exact interval?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-find-hosts-that-perform-web-requests-to/m-p/151771#M42490</link>
      <description>&lt;P&gt;i am trying to think of a way to craft a search that will look for any hosts doing web-requests to the same site/url at regular the same intervals. &lt;BR /&gt;
Basic idea is that Host A does a request to WebsiteA every X amount of seconds/minutes (if i could add a range like every 15-20 seconds that would be even better due to timing of logs etc.. ).&lt;/P&gt;

&lt;P&gt;Any ideas on how to do this in splunk? &lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2015 15:41:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-find-hosts-that-perform-web-requests-to/m-p/151771#M42490</guid>
      <dc:creator>ng87</dc:creator>
      <dc:date>2015-04-20T15:41:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search to find hosts that perform web requests to the same site/url at an exact interval?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-find-hosts-that-perform-web-requests-to/m-p/151772#M42491</link>
      <description>&lt;P&gt;Group your items by &lt;CODE&gt;Host&lt;/CODE&gt; and &lt;CODE&gt;Website&lt;/CODE&gt; and get time deltas on them by using &lt;CODE&gt;streamstats&lt;/CODE&gt;across them with a window encompassing just the previous item (size of 2), and using &lt;CODE&gt;global=f&lt;/CODE&gt; to ensure that the time deltas are by group:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...[original search]... | streamstats window=2 global=f range(_time) as timedelta by Host Website
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then, remove the 0's (which all of the last entries for each Host/Website combo will have) and do some statistics:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... 
| where timedelta &amp;gt; 0 
| stats avg(timedelta) as DeltaAvg range(timedelta) as DeltaRange by Host Website 
| table Host Website DeltaAvg DeltaRange
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then filter to what you need beyond that.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2015 17:31:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-find-hosts-that-perform-web-requests-to/m-p/151772#M42491</guid>
      <dc:creator>aweitzman</dc:creator>
      <dc:date>2015-04-20T17:31:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search to find hosts that perform web requests to the same site/url at an exact interval?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-find-hosts-that-perform-web-requests-to/m-p/151773#M42492</link>
      <description>&lt;P&gt;thanks a lot, looks promising, will give that a go tomorrow. &lt;BR /&gt;
 could i increase the window to a lot more than 2? ( as 2 will give me loads of results where something more like 10-15 will really filter it down to what i am looking for )&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2015 19:39:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-find-hosts-that-perform-web-requests-to/m-p/151773#M42492</guid>
      <dc:creator>ng87</dc:creator>
      <dc:date>2015-04-20T19:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search to find hosts that perform web requests to the same site/url at an exact interval?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-find-hosts-that-perform-web-requests-to/m-p/151774#M42493</link>
      <description>&lt;P&gt;I'm not sure what you mean. &lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;&lt;CODE&gt;streamstats&lt;/CODE&gt; only allows you to perform aggregate operations on the items in your window, so if you had more than two events in the window, there's no operation you could use to determine the time delta between each event, which is what you're looking for. You need to ensure that the events are consecutive (within the group), and then you can use the &lt;CODE&gt;range&lt;/CODE&gt; operation to get what you need.&lt;/LI&gt;
&lt;LI&gt;By performing the &lt;CODE&gt;stats&lt;/CODE&gt; command after the &lt;CODE&gt;streamstats&lt;/CODE&gt; you are reducing the number of results for each Host-Website combination to 1, so you shouldn't be overly burdened with results.&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;However, if what you care about is that you are getting too many Host-Website combinations, and only care about ones that happen relatively frequently, then what you want to do is add a &lt;CODE&gt;stats&lt;/CODE&gt; that just does a count in the group, and then filter out smaller counts:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...[original search]... 
| streamstats window=2 global=f range(_time) as timedelta by Host Website
| where timedelta &amp;gt; 0
| stats count as n avg(timedelta) as DeltaAvg range(timedelta) as DeltaRange by Host Website
| table Host Website n DeltaAvg DeltaRange
| where n&amp;gt;10
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 Apr 2015 20:03:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-find-hosts-that-perform-web-requests-to/m-p/151774#M42493</guid>
      <dc:creator>aweitzman</dc:creator>
      <dc:date>2015-04-20T20:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a search to find hosts that perform web requests to the same site/url at an exact interval?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-find-hosts-that-perform-web-requests-to/m-p/151775#M42494</link>
      <description>&lt;P&gt;Hi to add a range of time,try with the following commands:&lt;/P&gt;

&lt;P&gt;span=.......s&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    OR
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;per_second( .....)&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2015 21:46:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-search-to-find-hosts-that-perform-web-requests-to/m-p/151775#M42494</guid>
      <dc:creator>stephane_cyrill</dc:creator>
      <dc:date>2015-04-20T21:46:25Z</dc:date>
    </item>
  </channel>
</rss>

