rsyslog: capture errors from "omprog" script

I am using custom python script to process logs, and ban offending IPs. Here is the line from my /etc/rsyslog.conf:

local0.*  action(type="omprog" name="asterisk" binary="/usr/local/sbin/asterisk.py")

When my script generates some error, I don’t see it anywhere in the logs (but I do see python errors when I run my script manually with given input)

Do I have to redirect the errors somewhere explicitly ?

I am using rsyslog 8.1901 on Debian 10

Asked By: 400 the Cat

||

When rsyslog runs the program, stderr is set to /dev/null, but you can add an output="/some/file" action parameter, and then stderr will be set to stdout, and any output on them will be written to the given file, which rsyslog will create if needed. Otherwise, you need to open a stderr in your program.

Answered By: meuh
Categories: Answers Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.