<?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: Splunk Alert for spike in log events in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/How-to-create-a-Splunk-Alert-for-spike-in-log-events/m-p/597359#M13836</link>
    <description>&lt;P data-unlink="true"&gt;Thank you for sharing your inputs and code logic.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I tried the below way: -&lt;BR /&gt;In the time range picker: "earliest: &lt;FONT color="#000000"&gt;-7d@d&lt;/FONT&gt;"&amp;nbsp;&amp;nbsp;"latest:now".&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=xxx sourcetype IN ("A","B")
| bin _time span=1d
| stats count by _time sourcetype
| eventstats avg(count) as average by sourcetype
| eval rise_percent=((count-average)*100)/count
|where rise_percent&amp;gt;=25&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;And I get results for each sourcetype when the count for a sourcetype on a given date is greater than average count by 25%.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I need your assistance to build SPL which takes average of past 15 days and compare it with today's results, but it should exclude today's date in the average. For example: - today is 11 May 2022, the past 15 days should be from 26 April 2022 to10 May 2022&lt;/P&gt;</description>
    <pubDate>Wed, 11 May 2022 10:54:48 GMT</pubDate>
    <dc:creator>Taruchit</dc:creator>
    <dc:date>2022-05-11T10:54:48Z</dc:date>
    <item>
      <title>How to create a Splunk Alert for spike in log events?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-create-a-Splunk-Alert-for-spike-in-log-events/m-p/571024#M13159</link>
      <description>&lt;P&gt;Trying to implement an alert on detecting spikes in logged events in our Splunk deployment and not sure how to go about it...&lt;BR /&gt;&lt;BR /&gt;For example: Have 15 hosts with varying levels of sources within each... one of my sources in a host averages about 5-6k events per day over the past 30 days; then out of the blue, we're hit with 1.3 million events on one of the days.&lt;BR /&gt;&lt;BR /&gt;Assuming the alert would need to be tailored to each host (or source, not sure) and would need an average number of events over a "normal" week to compare to when there's a spike?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2022 22:46:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-create-a-Splunk-Alert-for-spike-in-log-events/m-p/571024#M13159</guid>
      <dc:creator>testingtena</dc:creator>
      <dc:date>2022-05-11T22:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Alert for spike in log events</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-create-a-Splunk-Alert-for-spike-in-log-events/m-p/571026#M13160</link>
      <description>&lt;P&gt;Something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;your search earliest=-7d@d latest=@d
| bin _time span=1d
| stats count by _time host
| eventstats avg(count) as average by host
| where _time&amp;gt;relative_time(now(),"-1d@d")
| where count &amp;gt; average&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 14 Oct 2021 16:57:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-create-a-Splunk-Alert-for-spike-in-log-events/m-p/571026#M13160</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-10-14T16:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Alert for spike in log events</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-create-a-Splunk-Alert-for-spike-in-log-events/m-p/571033#M13161</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SplunkCommunity.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/16433i01C1D8B4522CAF57/image-size/large?v=v2&amp;amp;px=999" role="button" title="SplunkCommunity.png" alt="SplunkCommunity.png" /&gt;&lt;/span&gt;Thanks for the quick reply &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt; but when I try running it I get the following.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 17:28:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-create-a-Splunk-Alert-for-spike-in-log-events/m-p/571033#M13161</guid>
      <dc:creator>testingtena</dc:creator>
      <dc:date>2021-10-14T17:28:04Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Alert for spike in log events</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-create-a-Splunk-Alert-for-spike-in-log-events/m-p/571034#M13162</link>
      <description>&lt;P&gt;Well it was just an example - you probably want to add an index or more to restrict your search depending on your actual data - similarly, it looks like you don't have host extracted so change this for something you do have that you want to group your data by - only you will know what this is as you didn't provide that information in your original post.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 17:33:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-create-a-Splunk-Alert-for-spike-in-log-events/m-p/571034#M13162</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-10-14T17:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Alert for spike in log events</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-create-a-Splunk-Alert-for-spike-in-log-events/m-p/597359#M13836</link>
      <description>&lt;P data-unlink="true"&gt;Thank you for sharing your inputs and code logic.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I tried the below way: -&lt;BR /&gt;In the time range picker: "earliest: &lt;FONT color="#000000"&gt;-7d@d&lt;/FONT&gt;"&amp;nbsp;&amp;nbsp;"latest:now".&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=xxx sourcetype IN ("A","B")
| bin _time span=1d
| stats count by _time sourcetype
| eventstats avg(count) as average by sourcetype
| eval rise_percent=((count-average)*100)/count
|where rise_percent&amp;gt;=25&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;And I get results for each sourcetype when the count for a sourcetype on a given date is greater than average count by 25%.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I need your assistance to build SPL which takes average of past 15 days and compare it with today's results, but it should exclude today's date in the average. For example: - today is 11 May 2022, the past 15 days should be from 26 April 2022 to10 May 2022&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2022 10:54:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-create-a-Splunk-Alert-for-spike-in-log-events/m-p/597359#M13836</guid>
      <dc:creator>Taruchit</dc:creator>
      <dc:date>2022-05-11T10:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Alert for spike in log events</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-create-a-Splunk-Alert-for-spike-in-log-events/m-p/597362#M13837</link>
      <description>&lt;P&gt;You could do something like this (with timepicker at &lt;A href="mailto:-15d@d" target="_blank"&gt;-15d@d&lt;/A&gt;)&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=xxx sourcetype IN ("A","B")
| bin _time span=1d
| stats count by _time sourcetype
| eval previous=if(_time&amp;lt;relative_time(now(),"@d"),count,null())
| eventstats avg(previous) as average by sourcetype
| eval rise_percent=((count-average)*100)/count
|where rise_percent&amp;gt;=25&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 11 May 2022 11:20:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-create-a-Splunk-Alert-for-spike-in-log-events/m-p/597362#M13837</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-05-11T11:20:48Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Alert for spike in log events</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-create-a-Splunk-Alert-for-spike-in-log-events/m-p/597407#M13840</link>
      <description>&lt;P&gt;Thank you for your prompt inputs.&lt;/P&gt;&lt;P&gt;I tried with following: -&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=xxx sourcetype IN ("A")
| bin _time span=1d
| stats count by _time sourcetype
| eval previous=if(_time&amp;lt;relative_time(now(),"@d"),count,null())&lt;/LI-CODE&gt;&lt;P&gt;Due to large volume of data, for testing purpose I only kept once sourcetype in the SPL and time range as Last 7 days.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;In output, I get table with following columns: -&lt;BR /&gt;_time&lt;BR /&gt;sourcetype&lt;BR /&gt;count&lt;BR /&gt;previous&lt;BR /&gt;&lt;BR /&gt;I get results for each date in past 7 days, however the values under column count and previous are same.&amp;nbsp;&lt;BR /&gt;Sample output: -&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="25%"&gt;&lt;STRONG&gt;_time&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;STRONG&gt;sourcetype&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;STRONG&gt;count&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;STRONG&gt;previous&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%"&gt;&lt;SPAN&gt;2022-05-04&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;A&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;SPAN&gt;1004558705&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;SPAN&gt;1004558705&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%"&gt;&lt;SPAN&gt;2022-05-05&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;A&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;SPAN&gt;2450936208&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;SPAN&gt;2450936208&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="25%"&gt;&lt;SPAN&gt;2022-05-06&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;A&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;SPAN&gt;3074060943&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="25%"&gt;&lt;SPAN&gt;3074060943&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;Thus, can you please help me to correct where I am going wrong.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2022 14:03:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-create-a-Splunk-Alert-for-spike-in-log-events/m-p/597407#M13840</guid>
      <dc:creator>Taruchit</dc:creator>
      <dc:date>2022-05-11T14:03:51Z</dc:date>
    </item>
  </channel>
</rss>

