1

I have been trying to pass captured log to a perl script, however I can not seem to find the right way. Do you have any suggestions for correct way of sending captured log to a script for further processing?

I can activate this script with this but, I can't pass the captured message:

$ModLoad omprog
$template MyTemplateName,"some\n"

if $programname == 'arpwatch' and $msg contains 'new station' then {
    action(type="omprog" binary="/tmp/somescript.pl" template="MyTemplateName")
}
1

Well... turns out it's easier than it looked like. For some reason I could not successfully apply "action", so I went for the old way of doing this. Captured log messaged is sent as argument in default template format if not specified otherwise.

if $programname == 'arpwatch' and $msg contains 'new station' then {
    ^/opt/bin/script.pl
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.