Automatic clear of ''ADMIN_EVENT_ENTITY'' table or Admin Evens Settings clear with a date

Good afternoon,

I am looking to clear the ‘‘ADMIN Events’’ on a scheduled based like it is possible for the ‘Login Events’’.
The reason is that the table ADMIN_EVENT_ENTITY in the DB is getting bigger and bigger over time and I don’t understand why should I keep of of theses records over time.

Unfortunately, there is now ‘‘field’’ for expiration for theses type of logs in the Keycloak interface.
Is there any other way other then running a SQL clean up job for that specific table ? Shouldn’t this be a included feature ? Should I request for it.

Please light up my way so I can understand better.

Regards,

P.S: I did look at section 15 in the DOC, but there is nothing about ‘‘expiration’’. for EVENTS

There is no way to periodic task to expire/clear admin events the same way you can with login events. It does sound like a good feature to request, as I’m sure others would like the same.

You could call the admin API periodically, but that’s almost as cumbersome as running a SQL cleanup job.

DELETE   https://{host}/auth/admin/realms/{realm}/admin-events

xgp, Thank you for you answer. The API could be another interesting way to do it.

Meanwhile, Ill do a request for that feature. Will try to update here.

Regards,

I just opened a JIRA ticket. Will see where this bring’s us.

Here is for reference: —>> https://issues.redhat.com/browse/KEYCLOAK-18295

1 Like