Problem:
How to fetch Last login details of any user in Spotfire Server.
Solution:
There are two ways to gather this information:
Option 1: Query USERS table in Spotfire Database:
SELECT USER_NAME, LAST_LOGIN
FROM [Spotfire_server_DB].USERS
Option 2: Query ACTION LOG database:
Prerequisite : Need to install and configure Action Log functionality:
Use the following query to get the last login of users (MS SQL Server):
SELECT t.user_name, t.LOGGED_TIME
from [sf_actionlog].[dbo].ACTIONLOG t
inner join (
select user_name, max(LOGGED_TIME) as MaxDate
from [sf_actionlog].[dbo].ACTIONLOG
WHERE (LOG_CATEGORY = 'auth') AND (LOG_ACTION = 'login')
group by user_name
) tm on t.user_name = tm.user_name and t.LOGGED_TIME = tm.MaxDate