Active user session info
select *
from AuditData ad
where ad.entityType = "USERSESSIONLOG"
and ad.username <> "system"
and ad.action = 0
and ad.createdDate >= (utc_timestamp() - interval 3 hour)
group by ad.entityId
having count(*) = 1
order by ad.username desc
;
It works correctly only if your Tomcat use timezone UTC application was started with this timezone.
Be careful: sometimes, you can get a daemon user session, for example, when you restart Tomcat, the audit plugin doesn't create an item that indicates the active user is finishing their session.