On Mon, 25 Jan 2016, John Tabasz wrote:

*This is where I hope to build the logic to create a new subject line based
on the message content. The below gives syntax errors. *

*The flow is:*

*If message contains 622001*

*  If field 1 contains "Adding" && field 12 contains "outside" *

*    build subject line "Adding route to Outside interface"*

*  else*

*  if field 1 contains "Removing" && field 12 contains "outside"*

*    build subject line "Removed route from Outside interface"*


*  else    ...*

*fi*
*Send email with new subject line and $msg in body*

if $msg contains '622001' then :ommail:;newMailSubject
$template(name="addOrRemove" type="string" string="%msg:F,32:1%")
set $AorR = exec_template("addOrRemove")

this is wrong, you can create $!AorR, but not $AorR

you also need to have a ; at the end of the line.

$template(name="outOrBk" type="string" string="%msg:F,32:13%")
set $intName = exec_template("outOrBk")
$template newMailSubject, "'%HOSTNAME%' - '%TIMESTAMP%' - '%msg%' - '$AorR'"

set $!AorR = exec_template("addOrRemove");
$template(name="outOrBk" type="string" string="%msg:F,32:13%")
set $!intName = exec_template("outOrBk");
$template newMailSubject, "'%HOSTNAME%' - '%TIMESTAMP%' - '%msg%' - '$!AorR'"

David Lang
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of 
sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE 
THAT.

Reply via email to