Username and last login daily stats

Problem statement

We want to create daily reports showing the last login time and username of anyone who logs into our site.
Any suggestions on the best way to access this data on a daily basis?

Solution

Unfortunately, the daily stats endpoint does not cover this level of detail. Instead, it only provides the number of logins and signups across the tenant:

We also have a new report within the Teams feature, but this also does not go into individual user level:

You can implement a log stream and monitor the successful login events on your side to correlate usernames with their most recent login.

This stream of events can be sent to one of the supported log analytics providers or a custom webhook you run on your infrastructure. This also has the benefit of not being limited to your tenant’s log retention, as you can store these logs on your side for as long as you require.