Before taking down an application for upgrade or maintenance we like to check which (if any) users are currently active (ie: have explicitly accessed a page).
Is there some way to report this (ideally with an SQL query), other than grepping the access log using something like:
fgrep -v -e '"GET /rest/' localhost_access_log.2012-12-06.txt | tail
We use a macro based on Andrew Frayling's work:
https://answers.atlassian.com/questions/33385/macro-that-produces-a-list-of-users-last-login-date
You can tweak it to get users who have accessed pages within the last few minutes, for example.
Another thing we do is use Google Analytics, and check the real-time stats. That will tell you how many users are currently using the site (within the last 1 minute, I think), and what pages they are on.
hth,
matt
Many thanks Matthew, I'll try that when I get some time.
For now, since Atlassian confirm they have nothing (https://support.atlassian.com/browse/CSP-92874) I'm using a slightly more elaborate access log report:
awk ' / "GET \/rest/ { next } # Ignore Ajax fetches { userName = $3 # $1: IP, $2: Hyphen usually TS = $4 # In form [dd/Mmm/yyyy:hh:mm:ss $5: +0000] $6: $GET $7: /url/... USERS[userName] = substr(TS, 2) # Array key is name, value is timestamp } END { for (userName in USERS) print USERS[userName], userName } ' `ls -t localhost_access_log.*.txt | sed -n 1,2p` | sort # Check last 2 days' logs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry - `back-quoted` command on last line above should have "| tac" at end. ie:
' `ls -t localhost_access_log.*.txt | sed -n 1,2p | tac` | sort
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Peter,
This SQL query should be enough to retrieve all users that belong in a group which has global permissions:
SELECT DISTINCT u.lower_user_name FROM cwd_user u JOIN cwd_membership m ON u.id = child_user_id JOIN cwd_group g ON m.parent_id = g.id JOIN spacepermissions sp ON g.group_name = sp.permgroupname WHERE permtype='USECONFLUENCE' AND u.active = 'T';
Hope it helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Alyson - that's handy, but I want currently active users. eg: to see if I need to postpone down time and/or contact them when about to take Confluence down.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.