<?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 Extensible Alerts in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Extensible-Alerts/m-p/38676#M429</link>
    <description>&lt;P&gt;I've created an alert in Splunk which essentially checks for any occurence of an event with a certain attribute EventType=&lt;EM&gt;SOMETHING&lt;/EM&gt;. If no events have been recorded for a specific time frame e.g 1 hour then it sends an email notification so we are aware the service sending the messages is having problems. &lt;/P&gt;

&lt;P&gt;We have several EventTypes that are sent and ideally we'd like to know if any of them were failing to coe through without having to write either an alert for each, or hardcode the values for the EventTypes within the alert. Is it possible to do this by have a list of values stored in a CSV file have have Splunk monitoring for each? For example if have a file containing:&lt;/P&gt;

&lt;P&gt;Type1, Type2, Type3&lt;/P&gt;

&lt;P&gt;then Splunk for monitoring events for each of these from a single alert, and fire an alert when it can't decide events for any one of these. So if there were no events for Type1 and Type2 we would get two emails.&lt;/P&gt;</description>
    <pubDate>Mon, 19 Nov 2012 14:32:16 GMT</pubDate>
    <dc:creator>paddy3883</dc:creator>
    <dc:date>2012-11-19T14:32:16Z</dc:date>
    <item>
      <title>Extensible Alerts</title>
      <link>https://community.splunk.com/t5/Alerting/Extensible-Alerts/m-p/38676#M429</link>
      <description>&lt;P&gt;I've created an alert in Splunk which essentially checks for any occurence of an event with a certain attribute EventType=&lt;EM&gt;SOMETHING&lt;/EM&gt;. If no events have been recorded for a specific time frame e.g 1 hour then it sends an email notification so we are aware the service sending the messages is having problems. &lt;/P&gt;

&lt;P&gt;We have several EventTypes that are sent and ideally we'd like to know if any of them were failing to coe through without having to write either an alert for each, or hardcode the values for the EventTypes within the alert. Is it possible to do this by have a list of values stored in a CSV file have have Splunk monitoring for each? For example if have a file containing:&lt;/P&gt;

&lt;P&gt;Type1, Type2, Type3&lt;/P&gt;

&lt;P&gt;then Splunk for monitoring events for each of these from a single alert, and fire an alert when it can't decide events for any one of these. So if there were no events for Type1 and Type2 we would get two emails.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Nov 2012 14:32:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Extensible-Alerts/m-p/38676#M429</guid>
      <dc:creator>paddy3883</dc:creator>
      <dc:date>2012-11-19T14:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: Extensible Alerts</title>
      <link>https://community.splunk.com/t5/Alerting/Extensible-Alerts/m-p/38677#M430</link>
      <description>&lt;P&gt;[My first answer was backwards. I deleted it. Try this one instead.]&lt;/P&gt;

&lt;P&gt;I think that a CSV file could be part of your solution, but here is my idea for how to accomplish this.&lt;/P&gt;

&lt;P&gt;First, create a CSV for the eventtypes that you want to monitor - one eventtype per &lt;EM&gt;line&lt;/EM&gt;. The first line &lt;STRONG&gt;must&lt;/STRONG&gt; be "eventtype"&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype
Type1
Type2
Type3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Upload the CSV file into Splunk and create a lookup. (There is a tutorial on &lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.1/Tutorial/Usefieldlookups"&gt;how to setup lookups&lt;/A&gt;.) I'll call the lookup alert_lookup in this example.&lt;/P&gt;

&lt;P&gt;Then tag each eventtype that you want to alert on, with a tag named "alert". Then the &lt;STRONG&gt;search&lt;/STRONG&gt; for your alert would be&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup alert_lookup
| join eventtype type=outer [ search tag=alert earliest=-24h latest=@h | stats count by eventtype  ]
| fillnull value=0 count
| where count = 0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;in the search box. Notice that this search looks back over the past 24 hours. (Yes, the first thing in the search box is the vertical bar; that's not a typo.) The &lt;STRONG&gt;criteria&lt;/STRONG&gt; for the alert would simply be&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;number of results &amp;gt; 0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You could set the alert to send one email for each result, or one email for all.&lt;/P&gt;

&lt;P&gt;I was unable to test this, so the search may be off, but the idea will definitely work. If you get any errors, pleae post back and I will help debug!&lt;/P&gt;</description>
      <pubDate>Wed, 21 Nov 2012 22:21:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Extensible-Alerts/m-p/38677#M430</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2012-11-21T22:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: Extensible Alerts</title>
      <link>https://community.splunk.com/t5/Alerting/Extensible-Alerts/m-p/38678#M431</link>
      <description>&lt;P&gt;After my last comment I actually went back and did some modifications to your original answer, based on some other documentation on Lookups from the Splunk site, and I managed to more or less replicate the new answer you provided! Many thanks for your assistance, I now have it fully working.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Nov 2012 10:56:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Extensible-Alerts/m-p/38678#M431</guid>
      <dc:creator>paddy3883</dc:creator>
      <dc:date>2012-11-22T10:56:53Z</dc:date>
    </item>
  </channel>
</rss>

