I've found that with large volumes of syslog data, a delete based on the datetime alone is not enough as MySQL can't complete the transaction in time so it fails. This has led to the build up of over 9m records in my test box alone.
This change now removes data in batches of 1000 without issue. It ran through 250,000 entries in 1 hour so should be fine now.
It also adds the clearing of authlog entries (logs web interface access).
Added authlog purge + improved efficiency of clearing out large syslo…
A couple of issues:
I don't think we should do the purging from poller or disco just in case it locks them up.
I'll change the loop = 0 to break and test it.
Updated the syslog loop to break when no more data can be deleted
Updated and tested against local install. Still loops through correctly and removes data when it needs to.
How does that loop work when $loop is not defined anywhere? Just use while (TRUE) ...