Difference between revisions of "LogAnalyzer Mods"
From The Linux Source
m |
m |
||
Line 1: | Line 1: | ||
PARENT PAGE LINK: [[LogAnalyzer]] | PARENT PAGE LINK: [[LogAnalyzer]] | ||
− | |||
=== Purging mySQL database === | === Purging mySQL database === |
Latest revision as of 12:45, 12 June 2017
PARENT PAGE LINK: LogAnalyzer
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