<?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: Alert only if value exists in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Alert-only-if-value-exists/m-p/288842#M10833</link>
    <description>&lt;P&gt;Do you need this? It would run every 30 min for last 30 minutes and will trigger only if the table has record/s for deny event based on deviceid:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xncsyslog action="deny" earliest=-30m latest=now
|dedup deviceid 
|table _time user deviceid devicetype action group agent ip
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Under alerts &lt;STRONG&gt;Trigger Conditions&lt;/STRONG&gt;  set to trigger when &lt;CODE&gt;Number of Results &amp;gt; 0&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Set on every 30 minutes cron schedule : &lt;CODE&gt;*/30 * * * *&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 27 Mar 2017 11:22:19 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2017-03-27T11:22:19Z</dc:date>
    <item>
      <title>Alert only if value exists</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-only-if-value-exists/m-p/288838#M10829</link>
      <description>&lt;P&gt;Hello Splunkers,&lt;/P&gt;

&lt;P&gt;We have a search that runs every 30 minutes, and then sends and email.  The problem is that there may not be a value in the results.  The search looks for a "deny" event.  We would like the search to run every 30 minutes, but ONLY send an email alert IF there are values in the results; in other words only if there is a deny event. &lt;/P&gt;

&lt;P&gt;index=xncsyslog | search action="deny" | dedup deviceid | fields _time action group user deviceid devicetype agent ip | table _time user deviceid devicetype action group agent ip&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2017 10:46:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-only-if-value-exists/m-p/288838#M10829</guid>
      <dc:creator>jaxjohnny</dc:creator>
      <dc:date>2017-03-27T10:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: Alert only if value exists</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-only-if-value-exists/m-p/288839#M10830</link>
      <description>&lt;P&gt;Do you need this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xncsyslog action="deny" 
|dedup deviceid 
|table _time user deviceid devicetype action group agent ip
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Under alerts &lt;STRONG&gt;Trigger Conditions&lt;/STRONG&gt;  set to trigger when &lt;CODE&gt;Number of Results &amp;gt; 0&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2017 11:18:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-only-if-value-exists/m-p/288839#M10830</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-03-27T11:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: Alert only if value exists</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-only-if-value-exists/m-p/288840#M10831</link>
      <description>&lt;P&gt;Hi jaxjohnny,&lt;BR /&gt;
to do what you want, you have to create a lookup with all your deviceid to monitor (calling it e.g. Perimeter.csv) in which there is a column called "deviceid" (and eventually other columns describing each device) and then run a search like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xncsyslog action="deny" 
| eval deviceid=upper(deviceid) 
| stats count by deviceid 
| append [ | inputlookup Perimeter.csv | eval count=0 | fields deviceid count ] 
| stats sum(count) AS Total by deviceid 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In this way, missed deviceids have &lt;CODE&gt;Total=0&lt;/CODE&gt;, the other have &lt;CODE&gt;Total&amp;gt;0&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;(Note that if you insert the search condition action="deny" after a | and a search command, your search is slower! and that you don't need to use the field command before table command).&lt;/P&gt;

&lt;P&gt;You can insert at the end of your search &lt;CODE&gt;| where Total=0&lt;/CODE&gt; and create an alert or create a dashboard that shows the status of your devices.&lt;/P&gt;

&lt;P&gt;You could also show status of your devices inserting at the end of your search &lt;CODE&gt;| rangemap field=Somma severe=0-0 low=1-1000000000 default=severe&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;If you like to show status of your devices in a graphic mode, follow the example in Splunk 6.x Dashboard Examples App (&lt;A href="https://splunkbase.splunk.com/app/1603/"&gt;https://splunkbase.splunk.com/app/1603/&lt;/A&gt;).&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2017 11:19:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-only-if-value-exists/m-p/288840#M10831</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-03-27T11:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: Alert only if value exists</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-only-if-value-exists/m-p/288841#M10832</link>
      <description>&lt;P&gt;Hi jaxjohnny,&lt;BR /&gt;
to do what you want, you have to create a lookup with all your deviceid to monitor (calling it e.g. Perimeter.csv) in which there is a column called "deviceid" (and eventually other columns describing each device) and then run a search like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xncsyslog action="deny" 
| eval deviceid=upper(deviceid) 
| stats count by deviceid 
| append [ | inputlookup Perimeter.csv | eval count=0 | fields deviceid count ] 
| stats sum(count) AS Total by deviceid 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In this way, missed deviceids have &lt;CODE&gt;Total=0&lt;/CODE&gt;, the other have &lt;CODE&gt;Total&amp;gt;0&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;(Note that if you insert the search condition action="deny" after a | and a search command, your search is slower! and that you don't need to use the field command before table command).&lt;/P&gt;

&lt;P&gt;You can insert at the end of your search &lt;CODE&gt;| where Total=0&lt;/CODE&gt; and create an alert or create a dashboard that shows the status of your devices.&lt;/P&gt;

&lt;P&gt;You could also show status of your devices inserting at the end of your search &lt;CODE&gt;| rangemap field=Somma severe=0-0 low=1-1000000000 default=severe&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;If you like to show status of your devices in a graphic mode, follow the example in Splunk 6.x Dashboard Examples App (&lt;A href="https://splunkbase.splunk.com/app/1603/"&gt;https://splunkbase.splunk.com/app/1603/&lt;/A&gt;).&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2017 11:19:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-only-if-value-exists/m-p/288841#M10832</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-03-27T11:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: Alert only if value exists</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-only-if-value-exists/m-p/288842#M10833</link>
      <description>&lt;P&gt;Do you need this? It would run every 30 min for last 30 minutes and will trigger only if the table has record/s for deny event based on deviceid:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xncsyslog action="deny" earliest=-30m latest=now
|dedup deviceid 
|table _time user deviceid devicetype action group agent ip
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Under alerts &lt;STRONG&gt;Trigger Conditions&lt;/STRONG&gt;  set to trigger when &lt;CODE&gt;Number of Results &amp;gt; 0&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Set on every 30 minutes cron schedule : &lt;CODE&gt;*/30 * * * *&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2017 11:22:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-only-if-value-exists/m-p/288842#M10833</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-03-27T11:22:19Z</dc:date>
    </item>
    <item>
      <title>Re: Alert only if value exists</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-only-if-value-exists/m-p/288843#M10834</link>
      <description>&lt;P&gt;Thank you.  However, we do not know which devices will attempt to connect.  These are all BYO devices connecting.  We have two portals.  One portal is permitted for all devices, while the other portal is approved only for select devices. &lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2017 11:45:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-only-if-value-exists/m-p/288843#M10834</guid>
      <dc:creator>jaxjohnny</dc:creator>
      <dc:date>2017-03-27T11:45:35Z</dc:date>
    </item>
    <item>
      <title>Re: Alert only if value exists</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-only-if-value-exists/m-p/288844#M10835</link>
      <description>&lt;P&gt;Thank you.  I've made this change to both the code and the trigger conditions.  The next report runs in about 10 minutes.  We'll see if this works. &lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2017 11:50:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-only-if-value-exists/m-p/288844#M10835</guid>
      <dc:creator>jaxjohnny</dc:creator>
      <dc:date>2017-03-27T11:50:22Z</dc:date>
    </item>
  </channel>
</rss>

