1 Reply Latest reply on Oct 21, 2015 12:11 PM by Glauber Ribeiro

    How to get session and most recent activity information from the database in V9?

    Glauber Ribeiro

      In Tableau Server v8, each valid user session (successfully logged in but not logged out or timed out) had a row in the _sessions view of the database. I could then join that to _http_requests (on session_id) to get the max timestamp, and that would give me the users logged in, and how recently they had been active, pretty much like the User Activity admin view (but much quicker).

       

      This doesn’t work in v9. Both views are still there, but if I join _sessions and _http_requests, I get NOTHING.

       

      Is the _sessions view (and/or underlying tables) still used in v9 for valid user sessions? How can I get the timestamp of the most recent action pertaining to that session?

       

      Thanks,

       

      glauber

        • 1. Re: How to get session and most recent activity information from the database in V9?
          Glauber Ribeiro

          I'm getting closer... the only thing i still don't have is the IP address for the session

           

          select b.user_ip, c.name, c.friendly_name, a.updated_at 
          from _sessions a
          left outer join _http_requests b on b.session_id = a.session_id  -- doesn't work
          join _users c on c.id = a.user_id
          order by a.updated_at desc

           

          I left the _http_requests as an left outer join, because it doesn't work. If it were a join, the SQL would return nothing. As it is, the IP address is always null. In real life, i'd probably just get _http_requests out of the join.

           

          I'm noticing that the admin views in V9 don't include the IP address, so maybe it's not possible to tell, in the current design. Which is a bummer, because it tells me where the user is coming from (internal in my company, or external).