<?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: Send Alert if # does not = 4 in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Send-Alert-if-does-not-4/m-p/195243#M56298</link>
    <description>&lt;P&gt;What you need to do is pull part of your search into the alert condition of your alert.  Use a search more like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=SidewinderFirewall 
Idsiwall1.ids.net OR idsiwall3.ids.net OR Idsiwall2.ids.net OR idsiwall4.ids.net 
| stats count by hostname 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then, when defining the scheduled search + alert, set an alert condition on "number of events" -&amp;gt; "does not equal" -&amp;gt; "4"&lt;/P&gt;

&lt;P&gt;&lt;IMG src="http://answers.splunk.com//storage/Screenshot.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;Then set the alert action to be the email, or any other action you need.  &lt;/P&gt;

&lt;P&gt;See docs at  &lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.2/Alert/Definescheduledalerts"&gt;http://docs.splunk.com/Documentation/Splunk/5.0.2/Alert/Definescheduledalerts&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 03 Jan 2014 17:44:36 GMT</pubDate>
    <dc:creator>dwaddle</dc:creator>
    <dc:date>2014-01-03T17:44:36Z</dc:date>
    <item>
      <title>Send Alert if # does not = 4</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Send-Alert-if-does-not-4/m-p/195242#M56297</link>
      <description>&lt;P&gt;What i am trying to do is send an alert if Alive_Iwalls does not equal 4. This will tell me if all of the firewalls are up and running. Any help would be greatly appreachiated. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=SidewinderFirewall Idsiwall1.ids.net OR idsiwall3.ids.net OR Idsiwall2.ids.net OR idsiwall4.ids.net | stats count by hostname | sort by count | stats count AS Alive_Iwalls | eval status = if(Alive_Iwalls == 4, "OK", "Error") | sendemail to="michael@SPL.com" if(status== error) 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Jan 2014 17:35:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Send-Alert-if-does-not-4/m-p/195242#M56297</guid>
      <dc:creator>taylormade2169</dc:creator>
      <dc:date>2014-01-03T17:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: Send Alert if # does not = 4</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Send-Alert-if-does-not-4/m-p/195243#M56298</link>
      <description>&lt;P&gt;What you need to do is pull part of your search into the alert condition of your alert.  Use a search more like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=SidewinderFirewall 
Idsiwall1.ids.net OR idsiwall3.ids.net OR Idsiwall2.ids.net OR idsiwall4.ids.net 
| stats count by hostname 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then, when defining the scheduled search + alert, set an alert condition on "number of events" -&amp;gt; "does not equal" -&amp;gt; "4"&lt;/P&gt;

&lt;P&gt;&lt;IMG src="http://answers.splunk.com//storage/Screenshot.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;Then set the alert action to be the email, or any other action you need.  &lt;/P&gt;

&lt;P&gt;See docs at  &lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.2/Alert/Definescheduledalerts"&gt;http://docs.splunk.com/Documentation/Splunk/5.0.2/Alert/Definescheduledalerts&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2014 17:44:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Send-Alert-if-does-not-4/m-p/195243#M56298</guid>
      <dc:creator>dwaddle</dc:creator>
      <dc:date>2014-01-03T17:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: Send Alert if # does not = 4</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Send-Alert-if-does-not-4/m-p/195244#M56299</link>
      <description>&lt;P&gt;sourcetype=SidewinderFirewall Idsiwall1.ids.net OR idsiwall3.ids.net OR Idsiwall2.ids.net OR idsiwall4.ids.net | stats count by hostname | sort by count | stats count AS Alive_Iwalls |Where Alive_Iwalls != 4&lt;/P&gt;

&lt;P&gt;No conditions required anymore&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:34:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Send-Alert-if-does-not-4/m-p/195244#M56299</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2020-09-28T15:34:35Z</dc:date>
    </item>
  </channel>
</rss>

