Skip to content

Instantly share code, notes, and snippets.

@Chris927
Created July 24, 2014 20:05
Show Gist options
  • Save Chris927/946e08497d692e237127 to your computer and use it in GitHub Desktop.
Save Chris927/946e08497d692e237127 to your computer and use it in GitHub Desktop.
How I got rsyslog to email me when 'demo' or 'test' appears (/etc/rsyslog.d/demo.conf)
$ModLoad /usr/lib/rsyslog/ommail.so
$ActionMailSMTPServer localhost
$ActionMailFrom rsyslog@uber5.com
$template mailSubject,"Rsyslog alert for %hostname% at %timegenerated%"
$template mailBody,"%msg%"
$ActionMailSubject mailSubject
$ActionExecOnlyonceEveryInterval 60
$ActionMailTo chris@uber5.com
if ($msg contains 'demo') or ($msg contains 'test') then :ommail:;mailBody
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment