<?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 search and set up an alert displaying hosts that are forwarding more data compared to the average of the previous week? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-set-up-an-alert-displaying-hosts-that-are/m-p/193319#M55633</link>
    <description>&lt;P&gt;Amazing answer as always. Only thing here to change is the search time range. earliest=-8d would give today vs last 7 days data volume, not specifically for today vs prior week (well on monday it will be today vs prior week). &lt;/P&gt;

&lt;P&gt;My suggestion would be to replace &lt;CODE&gt;"earliest=-8d&lt;/CODE&gt;" with " &lt;CODE&gt;((earliest=@d ) OR (earliest=-1w@w1 latest=@w1))&lt;/CODE&gt;" to capture data logged for today and prior week from Mon-Sun.&lt;/P&gt;</description>
    <pubDate>Fri, 16 Jan 2015 19:43:58 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2015-01-16T19:43:58Z</dc:date>
    <item>
      <title>How to search and set up an alert displaying hosts that are forwarding more data compared to the average of the previous week?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-set-up-an-alert-displaying-hosts-that-are/m-p/193315#M55629</link>
      <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;

&lt;P&gt;I want to trigger an alert with a list of hosts that are sending more data compared to the Average of all hosts from the previous week.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Eg: The week start from Mon-Sunday has Average(divided by 7) data per host and have added 50% threshold (to compare if its increase is more than this to triggered the alert)   
 HostA: 10mb + 5 (50 %)
 HostB: 5mb   +  2.5(50%)
 HostC: 1mb  + 0.5(50%)

and Yesterday the hosts status are
 HostA: 2mb
 HostB: 4mb
 HostC: 2mb 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have this search query which will get the hosts sending data more today &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* earliest=-5m | eval esize=len(_raw) | stats count max(esize) by host, source | top host | fields - count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but I don't know how to write it for the above scenario.&lt;/P&gt;

&lt;P&gt;Can any one help me on this.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jan 2015 11:49:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-set-up-an-alert-displaying-hosts-that-are/m-p/193315#M55629</guid>
      <dc:creator>snehal8</dc:creator>
      <dc:date>2015-01-14T11:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and set up an alert displaying hosts that are forwarding more data compared to the average of the previous week?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-set-up-an-alert-displaying-hosts-that-are/m-p/193316#M55630</link>
      <description>&lt;P&gt;Wow - I think you are doing this the hard way. Instead of looking at the events, use the _internal index to see how much the forwarders are sending. _internal also includes the fact that the forwarders send their internal logs, but that's a pretty constant amount so you can still compute when a forwarder starts sending more than usual.  Here is a search to get you started:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal source=*metrics.log group=tcpin_connections earliest=-8d
| eval Forwarder=if(isnull(hostname), sourceHost,hostname) 
| eval Today=if(_time&amp;gt;relative_time(now(),"@d"),"Today","PriorWeek")
| bucket span=1d _time
| stats sum(kb) as DailyKB by Forwarder Today _time
| chart avg(DailyKB)  by Forwarder Today
| where Today &amp;gt; PriorWeek * 1.5
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will probably run faster than your solution too, as it will not look at nearly so many events.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jan 2015 20:55:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-set-up-an-alert-displaying-hosts-that-are/m-p/193316#M55630</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2015-01-15T20:55:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and set up an alert displaying hosts that are forwarding more data compared to the average of the previous week?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-set-up-an-alert-displaying-hosts-that-are/m-p/193317#M55631</link>
      <description>&lt;P&gt;Thank you @Anonymous, but i am not getting  mean of this "Today=if(_time&amp;gt;relative_time(now(),"@d"),"Today","PriorWeek")", in this "PriorWeek", is this predefined?  please could you give me detail it will be grateful. thanks  &lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:41:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-set-up-an-alert-displaying-hosts-that-are/m-p/193317#M55631</guid>
      <dc:creator>snehal8</dc:creator>
      <dc:date>2020-09-28T18:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and set up an alert displaying hosts that are forwarding more data compared to the average of the previous week?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-set-up-an-alert-displaying-hosts-that-are/m-p/193318#M55632</link>
      <description>&lt;P&gt;The &lt;CODE&gt;eval Today=...&lt;/CODE&gt; statement is setting a new field called Today. If the timestamp of the event is after midnight, then the value of the field is set to "Today". If the timestamp of the event is before midnight, then the field is set to "PriorWeek". &lt;/P&gt;

&lt;P&gt;I should probably have named the field "TimeGroup" or something; Today is not a good field name, but it should work.  At any rate, the chart command transforms the data so that there should be 2 columns in the results: one column named "Today" and one column named "PriorWeek".&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jan 2015 19:00:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-set-up-an-alert-displaying-hosts-that-are/m-p/193318#M55632</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2015-01-16T19:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and set up an alert displaying hosts that are forwarding more data compared to the average of the previous week?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-set-up-an-alert-displaying-hosts-that-are/m-p/193319#M55633</link>
      <description>&lt;P&gt;Amazing answer as always. Only thing here to change is the search time range. earliest=-8d would give today vs last 7 days data volume, not specifically for today vs prior week (well on monday it will be today vs prior week). &lt;/P&gt;

&lt;P&gt;My suggestion would be to replace &lt;CODE&gt;"earliest=-8d&lt;/CODE&gt;" with " &lt;CODE&gt;((earliest=@d ) OR (earliest=-1w@w1 latest=@w1))&lt;/CODE&gt;" to capture data logged for today and prior week from Mon-Sun.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Jan 2015 19:43:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-set-up-an-alert-displaying-hosts-that-are/m-p/193319#M55633</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-01-16T19:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and set up an alert displaying hosts that are forwarding more data compared to the average of the previous week?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-set-up-an-alert-displaying-hosts-that-are/m-p/193320#M55634</link>
      <description>&lt;P&gt;Thanks @lguinn now i understand &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Mon, 19 Jan 2015 09:32:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-set-up-an-alert-displaying-hosts-that-are/m-p/193320#M55634</guid>
      <dc:creator>snehal8</dc:creator>
      <dc:date>2015-01-19T09:32:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and set up an alert displaying hosts that are forwarding more data compared to the average of the previous week?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-set-up-an-alert-displaying-hosts-that-are/m-p/193321#M55635</link>
      <description>&lt;P&gt;Thanks @somesoni will use this.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jan 2015 11:51:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-set-up-an-alert-displaying-hosts-that-are/m-p/193321#M55635</guid>
      <dc:creator>snehal8</dc:creator>
      <dc:date>2015-01-19T11:51:54Z</dc:date>
    </item>
  </channel>
</rss>

