<?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 edit my timechart search to alert when the number of events has dropped by over 80%? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-timechart-search-to-alert-when-the-number-of/m-p/200866#M58244</link>
    <description>&lt;P&gt;HI &lt;/P&gt;

&lt;P&gt;At the moment I am running a search on a some log files, and looking to trigger an alert when the number of events has dropped by over 80%.&lt;/P&gt;

&lt;P&gt;Currently, my alert triggers on a cron schedule every 5 minutes and the most recent time on the triggered alert, it always has a count of 0. With a drop of however many 5 minutes previously had been counted.&lt;/P&gt;

&lt;P&gt;This is my search at present:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=iis   earliest=-20m  "stringtomatchhere" | timechart  span=5m count   | delta  count as difference   | eval  percentDifference =round(abs(difference/(count - difference))*100)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Where I am looking to find all events that match the string which forms part of the uri-stem, chart this at 5 min gaps for the past 20mins.&lt;BR /&gt;
delta the count as difference, and then get the percentage difference.&lt;/P&gt;

&lt;P&gt;An example of results returned :&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="searchRes"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/1049i9C4007E1D5B3C1BC/image-size/large?v=v2&amp;amp;px=999" role="button" title="searchRes" alt="searchRes" /&gt;&lt;/span&gt;&lt;BR /&gt;
The tigger conditions are search difference &amp;lt; 0 AND percentDifference &amp;gt; 80  - so I would like to show only where there is a  drop in number of events, and that drop is of min 80%.&lt;/P&gt;

&lt;P&gt;I have it set to run on a cron schedule every 5 mins with a 10m, -5m window.&lt;/P&gt;

&lt;P&gt;If anyone could help point me in the right direction be much appreciated, just learning the ways of the splunking force.&lt;/P&gt;

&lt;P&gt;Thanks for the help&lt;BR /&gt;
S&lt;/P&gt;</description>
    <pubDate>Thu, 11 Feb 2016 08:59:30 GMT</pubDate>
    <dc:creator>insaneteddie</dc:creator>
    <dc:date>2016-02-11T08:59:30Z</dc:date>
    <item>
      <title>How to edit my timechart search to alert when the number of events has dropped by over 80%?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-timechart-search-to-alert-when-the-number-of/m-p/200866#M58244</link>
      <description>&lt;P&gt;HI &lt;/P&gt;

&lt;P&gt;At the moment I am running a search on a some log files, and looking to trigger an alert when the number of events has dropped by over 80%.&lt;/P&gt;

&lt;P&gt;Currently, my alert triggers on a cron schedule every 5 minutes and the most recent time on the triggered alert, it always has a count of 0. With a drop of however many 5 minutes previously had been counted.&lt;/P&gt;

&lt;P&gt;This is my search at present:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=iis   earliest=-20m  "stringtomatchhere" | timechart  span=5m count   | delta  count as difference   | eval  percentDifference =round(abs(difference/(count - difference))*100)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Where I am looking to find all events that match the string which forms part of the uri-stem, chart this at 5 min gaps for the past 20mins.&lt;BR /&gt;
delta the count as difference, and then get the percentage difference.&lt;/P&gt;

&lt;P&gt;An example of results returned :&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="searchRes"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/1049i9C4007E1D5B3C1BC/image-size/large?v=v2&amp;amp;px=999" role="button" title="searchRes" alt="searchRes" /&gt;&lt;/span&gt;&lt;BR /&gt;
The tigger conditions are search difference &amp;lt; 0 AND percentDifference &amp;gt; 80  - so I would like to show only where there is a  drop in number of events, and that drop is of min 80%.&lt;/P&gt;

&lt;P&gt;I have it set to run on a cron schedule every 5 mins with a 10m, -5m window.&lt;/P&gt;

&lt;P&gt;If anyone could help point me in the right direction be much appreciated, just learning the ways of the splunking force.&lt;/P&gt;

&lt;P&gt;Thanks for the help&lt;BR /&gt;
S&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2016 08:59:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-timechart-search-to-alert-when-the-number-of/m-p/200866#M58244</guid>
      <dc:creator>insaneteddie</dc:creator>
      <dc:date>2016-02-11T08:59:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my timechart search to alert when the number of events has dropped by over 80%?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-timechart-search-to-alert-when-the-number-of/m-p/200867#M58245</link>
      <description>&lt;P&gt;When you run your searches every 5 minutes, splunk considers the current time also into timechart, ie; let's say you are running search at 10:30:01 and splunk considers 10:30-10:35 also (partial bucket) and all of your events might not have reached splunk by that time. &lt;/P&gt;

&lt;P&gt;To avoid this , you can enable the option &lt;CODE&gt;partial=false&lt;/CODE&gt; in timechart and this will exclude any partial buckets (beginning or end). &lt;/P&gt;

&lt;P&gt;You can also add a 0 as dummy value for the first bucket (&lt;CODE&gt;eval difference=coalesce(difference,0)&lt;/CODE&gt;) since there are no previous value to compare, not mandatory though.&lt;/P&gt;

&lt;P&gt;The final search will be &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=iis   earliest=-20m  "stringtomatchhere" | timechart  span=5m partial=false count   | delta  count as difference|eval difference=coalesce(difference,0)   | eval  percentDifference =round(abs(difference/(count - difference))*100)|where (difference &amp;lt; 1 AND percentDifference &amp;gt; 80)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Feb 2016 03:49:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-timechart-search-to-alert-when-the-number-of/m-p/200867#M58245</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2016-02-12T03:49:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my timechart search to alert when the number of events has dropped by over 80%?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-timechart-search-to-alert-when-the-number-of/m-p/200868#M58246</link>
      <description>&lt;P&gt;Thanks very much, that is a great help, &lt;BR /&gt;
I am still learning the abilities and workings of this fantastic splunk software.&lt;BR /&gt;
Steve&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2016 08:45:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-timechart-search-to-alert-when-the-number-of/m-p/200868#M58246</guid>
      <dc:creator>insaneteddie</dc:creator>
      <dc:date>2016-02-12T08:45:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my timechart search to alert when the number of events has dropped by over 80%?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-timechart-search-to-alert-when-the-number-of/m-p/200869#M58247</link>
      <description>&lt;P&gt;Hi Steve - if the answer from @renjith.nair worked for you be sure to "accept" it . There should be a button above the comments section, next to "Award Points"&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2016 10:55:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-timechart-search-to-alert-when-the-number-of/m-p/200869#M58247</guid>
      <dc:creator>jplumsdaine22</dc:creator>
      <dc:date>2016-02-12T10:55:49Z</dc:date>
    </item>
  </channel>
</rss>

