Liferay: Groovy Script to Clean Up Audit Events

March 1st, 2022 — Liferay EE/DXP comes with an Audit functionality, which logs all user actions. This may be very helpful to understand what happened inside your system, e.g., if incidents occur, but it may also generate a large data grave. In my case, it generated more than 3 Gigabyte of logging information over several years. Because there was no way to delete old entries via the Control Panel, I wrote a little Groovy script to take care of this task.