is it possible to intercept syslog messages and evaluate (in special cases change) them before they are written into /var/log/?
At the moment i m using inotify to monitor the log file and write the evaluated log into a new file.
is it possible to intercept syslog messages and evaluate (in special cases change) them before they are written into /var/log/?
At the moment i m using inotify to monitor the log file and write the evaluated log into a new file.
Yes, it is possible. You can do it with syslog-ng
and filters if you're creative.
No, I'm not going to tell you specifically how to do it, because it's a TERRIBLE idea.
As a general rule you do not alter the data you're logging. You log raw data, and post-process it prior to displaying it if necessary. Altering log data destroys the integrity of the logging process - it's the equivalent to planting evidence in a criminal case.