Newer Version Available
LogoutEvent (Beta)
Tracks user UI logouts. A logout event records a successful user
logout from your org’s UI. LogoutEvent is a big object that stores the event data
of LogoutEventStream. This object is available in API version 45.0 and later.
Use LogoutEvent data to implement custom logic during logout. For example, you can
revoke all refresh tokens for a user at logout.
Supported Calls
describeSObjects(), query()
Special Access Rules
Accessing this object requires the Shield Event Monitoring add-on, and the View Data Leakage Detection Events and API Enabled user permissions.
Fields
| Field Name | Details |
|---|---|
| EventDate |
|
| EventIdentifier |
|
| LoginKey |
|
| SessionKey |
|
| SessionLevel |
|
| SourceIp |
|
| UserId |
|
| Username |
|
Standard SOQL Usage
Currently, the only supported SOQL function on LogoutEvent is WHERE, and you can only use comparison operators (=,
<, >, <=, and >=) on the final expression in a WHERE clause. The != operator isn’t supported.
LogoutEvent allows filtering over two ordered
fields: EventDate and EventIdentifier.
There’s a catch here; your query won’t work unless you use the correct order and
combination of these fields. The following list provides some examples of valid and
invalid queries:
-
Unfiltered
-
Valid—Contains no WHERE clause, so no special rules
apply.
-
Valid—Contains no WHERE clause, so no special rules
apply.
-
Filtered on EventDate
-
Valid—You can filter solely on
EventDate, but single filters on other
fields fail. You can also use a comparison operator in this query
type.
-
Valid—You can filter on EventDate
using date
literals.
-
Valid—You can filter solely on
EventDate, but single filters on other
fields fail. You can also use a comparison operator in this query
type.
-
Filtered on EventDate and
EventIdentifier
-
Valid—Successful queries on LogoutEvent filter over
both
fields.
-
Invalid—Queries on LogoutEvent with
EventDate and standard date
literals.
-
Invalid—Filtering only on
EventDate with <= or >= operator and
EventIdentifier field isn’t
supported.
-
Valid—Successful queries on LogoutEvent filter over
both
fields.
Async SOQL Usage
With Async SOQL, you can filter on any field in LogoutEvent and use any comparison operator in your query.
Example: Get Yesterday’s Successful Logouts
SELECT EventDate, EventIdentifier, SourceIp, UserId FROM LogoutEvent WHERE EventDate<Yesterday