Expand my Community achievements bar.

SOLVED

AEM active user in aem 6.3

Avatar

Level 2

Hi ,

I need to fetch list active aem users  for a certain period of time in aem author environment for some business requirement  .  Can you help ways to find out.

TIA.

1 Accepted Solution

Avatar

Correct answer by
Level 8

Yes, there is no property to track user status under home/users

If it is a new requirement then I suggest you to use Sling Filters, this will fire for every request, so you can read the username and write it in either separate log file or use impersonation and write a new property to the logged in USER which is active=true

The first approach is very useful when you want to track other things not only usernames and the second approach is useful when you want to find only usernames by writing a simple query

Just a thought, First, check your requirements and if your requirements meet audit logs then you can check audit logs also, but you need to query audit logs

http://keysandstrokes.info/aem-sling-filters/

If you want to find out on the existing repository then

You can take out the logs and write simple java utility but I am not sure this will contains the username or not, but you need to check

Another approach which is complex one is writing a query which executes based on the date range predicate filter, get the list of the users and query against each node on lastModifiedBy property, but I am not sure this will meet your exact requirement or not. because if the author is not modified?

View solution in original post

5 Replies

Avatar

Level 10

You can use Query Builder API to retrieve users as suggested in this community thread - can i retrieve the users list and along with their group names in query builder?

However - in AEM - the user node does not contain a property that tracks if a user has been active:

UserNode.png

Avatar

Level 10

See this thread for a similiar discussion on tracking user activity - How to log / monitor user activity in AEM6

Avatar

Administrator

These 3 logs can help you with your use-case:

  • access.log : All access requests to AEM WCM and the repository are registered here.
  • audit.log. Moderation actions are registered here.
  • request.log Each access request is registered here together with the response.

Logs are located at <cq-installation-dir>/crx-quickstart/logs



Kautuk Sahni

Avatar

Correct answer by
Level 8

Yes, there is no property to track user status under home/users

If it is a new requirement then I suggest you to use Sling Filters, this will fire for every request, so you can read the username and write it in either separate log file or use impersonation and write a new property to the logged in USER which is active=true

The first approach is very useful when you want to track other things not only usernames and the second approach is useful when you want to find only usernames by writing a simple query

Just a thought, First, check your requirements and if your requirements meet audit logs then you can check audit logs also, but you need to query audit logs

http://keysandstrokes.info/aem-sling-filters/

If you want to find out on the existing repository then

You can take out the logs and write simple java utility but I am not sure this will contains the username or not, but you need to check

Another approach which is complex one is writing a query which executes based on the date range predicate filter, get the list of the users and query against each node on lastModifiedBy property, but I am not sure this will meet your exact requirement or not. because if the author is not modified?