Difference between revisions of "LogAnalyzer Mods"

From The Linux Source
Jump to: navigation, search
(Created page with "=== Purging mySQL database === This rsyslog configuration writes everything to a mySql database, as well as to the standard log files. The OS has the logrotate process to man...")
(No difference)

Revision as of 13:44, 12 June 2017

Purging mySQL database

This rsyslog configuration writes everything to a mySql database, as well as to the standard log files. The OS has the logrotate process to manage the log files, but if you wish to manage or periodically purge the mySql data, you can set up the following cron job (thanks to Michael Meckelein for posting this in a forum):
NOTE: you may want to setup another user which has delete permissions (like syslog-purge) to do the periodic cleanup for this cron process

mysql -u syslog-purge -p somepwA -e “delete from SystemEvents where ReceivedAt < date_add(current_date, interval -28 day)” Syslog