Audit Log removal

Dear All,
I have enabled Audit log for both locations and now want to remove logs using this commands ( pi-manage rotate_audit --age -1) but getting below error.

raise Exception(“We only rotate SQL audit module. You are using %s” %
Exception: We only rotate SQL audit module. You are using privacyidea.lib.auditmodules.containeraudit

how to achieve this, please suggest.
Thanks.

If you have a SQL module in your containermodule you have to rotate it manually. This is not supported by pi-manage.

I.e. simply deleting entry from the audit table starting from a certain date.

 DELETE from pidea_audit where date < ....;

You can put the sql statement into a shell script into a cron job and you are done.

PS: If you are running a redundant setup, you must only run the audit rotation on one node, the deletion will be replicated to the second node. Otherwise (running on both nodes) you might get replication errors.

Dear Cornelinux,

Thank you so much for your quick revert.

This is the reason, we use to call you and your product special :slight_smile: Thank you so much.
Will try and revert you in case have any issue.

Thanks.

1 Like