
Now, I just need to restart rsyslogd process and the logs will start to be processed as expected, and you should get the raw logs in /var/log/maillog and the filtered ones in /var/log/rsyslog_postfix.log systemctl restart rsyslog Process every log line with my python script in order to extract only some specific informations that I will write in /var/log/rsyslog_postfix.logīinary="/usr/bin/python3 /opt/rsyslog_postfix.py".


Redirect the current log to /var/log/maillog as a default path (to keep the raw log).Let’s go with a simple example, I want to filter my logs from postfix and only extract few specific information.īelow is the configuration I will now push to /etc/rsyslog.d/rsyslog_nf in order to: Thanks to that module, you can just ask rsyslog to execute a script on every logs you have from a specific application and process it with your own rules. If you want to filter some specific logs and redirect them to another server or to another file, you can use the module provided with rsyslog called “omprog”.
