Ability to call external scripts on matches

This is the place for you, if you got rsyslog up and running but wonder how to make it do what you want.

Moderator: rgerhards

Ability to call external scripts on matches

Postby bmccall » Wed Oct 22, 2008 4:34 pm

Would anyone happen to know, or perhaps created their own method, to call an external script on a string match? Something similar to the example below?

Code: Select all
if $syslogfacility-text == 'local0' and $msg startswith 'DEVNAME' and not ($msg contains 'error1' or $msg contains 'error0') then 'run_my_script_somehow'
bmccall
New
 
Posts: 6
Joined: Fri Aug 15, 2008 7:45 pm

Professional Services Information

  • Custom written rsyslog.conf?
  • Maintenance Contract?
  • Installation support?

Re: Ability to call external scripts on matches

Postby rgerhards » Wed Oct 22, 2008 4:36 pm

You can use the "shell execute" action together with this rule. See: http://www.rsyslog.com/doc-rsyslog_conf.html search for "shell execute" to find the right section.
User avatar
rgerhards
Site Admin
 
Posts: 2647
Joined: Thu Feb 13, 2003 11:57 am

Re: Ability to call external scripts on matches

Postby bmccall » Wed Oct 22, 2008 6:42 pm

Wow.. batting 1000 with that one. :oops: It's right in rsyslog_conf.html Thank you for the direction.
bmccall
New
 
Posts: 6
Joined: Fri Aug 15, 2008 7:45 pm

Re: Ability to call external scripts on matches

Postby rgerhards » Thu Oct 23, 2008 9:10 am

No problem. The doc structure is, umm, not optimal ;)
User avatar
rgerhards
Site Admin
 
Posts: 2647
Joined: Thu Feb 13, 2003 11:57 am

Google Ads



Return to Configuration

Who is online

Users browsing this forum: No registered users and 0 guests

cron