Not a report but bash shell query for 24 hour activity ...
script called '24hr' and is executable - contents:
mysql -u root -p -e "use moodle;select userid,action,other,ip,realuserid,origin,ip,timecreated from mdl_logstore_standard_log WHERE timecreated > UNIX_TIMESTAMP(NOW() - INTERVAL 24 HOUR);" > 24hours.txt; cat 24hours.txt|more; wc -l 24hours.txt
24hours.txt looks like:
userid action other ip realuserid origin ip timecreated
12539 viewed N; 10.14.7.81 NULL web 10.14.7.81 1634760025
12539 viewed N; 10.14.7.81 NULL web 10.14.7.81 1634760027
12117 viewed N; 10.14.14.234 NULL web 10.14.14.234 1634760032
11979 viewed N; 45.25.37.162 NULL web 45.25.37.162 1634760036
If one uses:
fgrep 'loggedin' 24hours.txt
output like this:
12500 loggedin a:1:{s:8:"username";s:9:"user.name";} 10.14.1.221 NULL web 10.14.1.221 1634845353
If one uses:
fgrep 'loggedout' 24hours.txt
output like this:
12111 loggedout a:1:{s:9:"sessionid";s:26:"baoe5brkbqm5r26morc7nscdaj";} 10.14.0.225 NULL web 10.14.0.225 1634760743
In this example:
fgrep 'loggedout' 24hours.txt |wc -l
26
26 users logged out
fgrep 'loggedin' 24hours.txt |wc -l
1070
1070 users logged
Bottom line ... will never 'match up' ... can't control users preventing them from closing the moodle window in browser.
Session eventually times out (240 seconds I think) ... but there is no record of session being erased in that table.
So kinda futile, IMHO! :|
'SoS', Ken