Use Async SOQL and UniqueKey for More Flexibility in Login Forensics

You can run Async SOQL queries and filter them on any field in the LoginEvent object, giving you flexibility in how you construct your queries. With Async SOQL, you can run queries in the background and retrieve results when you’re ready. The new UniqueKey field is used as the primary key instead of Id.
Available in: Enterprise, Performance, and Unlimited Editions

You can filter Async SOQL queries on any field, not just EventDate or Id. You can also use all operators, including comparison operators such as <= and =>.

Example: Get Yesterday’s Last 10 Successful Logins

SELECT Application, Browser, EventDate, UniqueKey, LoginUrl, UserId FROM LoginEvent WHERE EventDate>Yesterday LIMIT 10 AND Status=’Success’

There are limits on the number of Async SOQL queries you can run in a given period. For details, see the Async SOQL Guide (Pilot).

Important

Important

The UniqueKey field in the LoginEvent object is now the unique identifier for each record. Use this field as the primary key in your queries instead of the Id field because Id isn’t populated in API version 40.0 and later. Also, as a result of modifications made to this release, LoginEvent data in your org from previous releases isn’t immediately available. It will be available within 7 days of the Summer ’17 release.