#1 2022-05-25 11:43:40

dmourao
Member
Registered: 2022-04-12

User Audit Log

Is it possible to extract the user audit log (when the user logged in, which reports were executed, etc..)?

Offline

#2 2022-05-27 10:08:46

eduardo
Administrator
Registered: 2016-11-01
Website

Re: User Audit Log

Hi dmourao,

you can query the audit log with dynamic lists, for example with this query:

 SELECT E.*, P.KEY_FIELD, P.VALUE
FROM RS_AUDIT_LOG_ENTRY E,
RS_AUDIT_LOG_PROPERTY P
WHERE
E.ENTITY_ID = P.LOG_ENTRY_ID

Depending on your requirements you may need to adapt the query (order by, filters, etc)

Regards,
Eduardo

Offline

#3 2022-05-27 10:12:18

eduardo
Administrator
Registered: 2016-11-01
Website

Re: User Audit Log

Hi dmourao,

for getting more information for example user logged information you can also use scripting, as there is currently no out-of-the-box way to do this.
Maybe this script helps:

import net.datenwerke.security.service.authenticator.*;
import net.datenwerke.security.service.usermanager.*;
import java.util.GregorianCalendar;

def uservice = GLOBALS.getRsService(UserManagerService.class);
def diff = 1000*60*60;
def now = new GregorianCalendar().getTimeInMillis();
GLOBALS.getRsService(AuthenticatorService.class).getLastRequests().collect({ key, value ->
uservice.getNodeById(key)?.getUsername() + " " + ((now-value)/1000/60) + " minutes ago\n"; 
}).join();

Regards,
Eduardo

Offline

Board footer

Powered by FluxBB