Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,414,280
Community Members
 
Community Events
170
Community Groups

get last login date of users in confluence (postgres)

hi

i want to get last login date of confluence users. try this but it return for some users "last update" or " last failed login date" instead of last login date.

 

any idea?

thanks

2 answers

1 accepted

0 votes
Answer accepted
WITH last_login_date AS
(SELECT user_id
      , to_timestamp(CAST(cua.attribute_value AS double precision)/1000) AS last_login
   FROM cwd_user_attribute cua
  WHERE cua.attribute_name = 'lastAuthenticated'
    AND to_timestamp(CAST(cua.attribute_value AS double precision)/1000) < (CURRENT_DATE))
SELECT c.user_name
     , li.successdate
     , g.group_name
  FROM cwd_user c
 INNER JOIN last_login_date l ON (c.id = l.user_id)
 INNER JOIN cwd_membership m  ON (c.id = m.child_user_id)
 INNER JOIN cwd_group g       ON (m.parent_id = g.id)
 INNER JOIN user_mapping um ON (c.user_name = um.username)
 INNER JOIN logininfo li ON (um.user_key = li.username)
 WHERE g.group_name LIKE 'CEO-%' ;

@me  The link you specified above this answer indicates you must specify a timeframe.  How is that done?  Thank you for any help in advance!

0 votes
Fadoua Community Leader Jul 17, 2021

@me 

Are you using Postgres or SQL?

Because on your title it says Postgres but for the tags you selected SQL

Best,

Fadoua

Postgres

@Fadoua any update?

Fadoua Community Leader Jul 20, 2021

@me I am still looking 

Fadoua Community Leader Jul 22, 2021

@me I checked every single document online. The only one I found is the same one you shared. You will need to specify the timeframe interval

https://confluence.atlassian.com/confkb/how-to-get-a-list-of-users-with-their-last-logon-times-985499701.html

Best of luck!

Fadoua

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events