(for my reference, conversation with Gemini to find the number of logged in users - and what they were doing - is at https://aistudio.google.com/prompts/1rp43v9LvY7d-b6pk82fgF0dDVQPWmJh8 )
Suggested database queries were -
SELECT COUNT(DISTINCT l.userid) AS unique_users_active
FROM mdl_logstore_standard_log l
WHERE l.timecreated BETWEEN [START_UNIX_TIMESTAMP] AND [END_UNIX_TIMESTAMP];
to find the number of logged in users, and to see what they were doing,
SELECT
u.username,
u.firstname,
u.lastname,
FROM_UNIXTIME(l.timecreated) AS time_of_action,
l.eventname,
l.component,
l.target
FROM mdl_logstore_standard_log l
JOIN mdl_user u ON u.id = l.userid
WHERE l.timecreated BETWEEN [START_UNIX_TIMESTAMP] AND [END_UNIX_TIMESTAMP]
ORDER BY l.timecreated ASC;
No comments:
Post a Comment