<?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: setup alert based on host event count compared with other host in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/setup-alert-based-on-host-event-count-compared-with-other-host/m-p/472995#M12655</link>
    <description>&lt;P&gt;@prakashaig ,&lt;/P&gt;

&lt;P&gt;You might need to find an avg event count (baseline) for the hosts and calculate the percentage of difference based on that.&lt;/P&gt;

&lt;P&gt;Try if this works for you &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your current search
|eventstats avg(eventCount ) as Avg
|eval percentage=abs(round((eventCount-avg)/avg*100,2))
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Alert based on the percentage of deviation&lt;/P&gt;</description>
    <pubDate>Thu, 16 Apr 2020 11:16:38 GMT</pubDate>
    <dc:creator>renjith_nair</dc:creator>
    <dc:date>2020-04-16T11:16:38Z</dc:date>
    <item>
      <title>setup alert based on host event count compared with other host</title>
      <link>https://community.splunk.com/t5/Alerting/setup-alert-based-on-host-event-count-compared-with-other-host/m-p/472994#M12654</link>
      <description>&lt;P&gt;I have 3 webservers which takes the traffic and that is load balanced with least connection based without any sticky sessions, so the traffic will be evenly loaded b/w these servers. looking to create alert if any of the host have less event count comparatively. have the below basic query which will look for specific event on all 3 access logs. we can get alert if there is no event by adding | search eventCount=0 but i need to get alert comparing to other host for example x server has 25 events and other server has 100 events which is above my threshold (75% difference). this will help me trouble shot the LB or may the process is X server is taking longer time to respond or something.&lt;/P&gt;

&lt;P&gt;index=x AND (host="x" OR host="y" OR host="&lt;EM&gt;z" ) AND source="*access&lt;/EM&gt;" AND  "&lt;EM&gt;xyz.com&lt;/EM&gt;" &lt;BR /&gt;
| search ResponseCode=200&lt;BR /&gt;
| inputlookup append=t apache_httpd.csv&lt;BR /&gt;
| stats count as eventCount by host&lt;/P&gt;

&lt;P&gt;apache_httpd.csv is nothing but as below&lt;BR /&gt;
host&lt;BR /&gt;
x&lt;BR /&gt;
y&lt;BR /&gt;
z&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:57:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/setup-alert-based-on-host-event-count-compared-with-other-host/m-p/472994#M12654</guid>
      <dc:creator>prakashaig</dc:creator>
      <dc:date>2020-09-30T04:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: setup alert based on host event count compared with other host</title>
      <link>https://community.splunk.com/t5/Alerting/setup-alert-based-on-host-event-count-compared-with-other-host/m-p/472995#M12655</link>
      <description>&lt;P&gt;@prakashaig ,&lt;/P&gt;

&lt;P&gt;You might need to find an avg event count (baseline) for the hosts and calculate the percentage of difference based on that.&lt;/P&gt;

&lt;P&gt;Try if this works for you &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your current search
|eventstats avg(eventCount ) as Avg
|eval percentage=abs(round((eventCount-avg)/avg*100,2))
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Alert based on the percentage of deviation&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 11:16:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/setup-alert-based-on-host-event-count-compared-with-other-host/m-p/472995#M12655</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2020-04-16T11:16:38Z</dc:date>
    </item>
  </channel>
</rss>

