HipChat Server / Data Center: How to capture client type usage stats

Still need help?

The Atlassian Community is here for you.

Ask the community

Purpose

To gather the client type statistics of the users who were logged in to the HipChat Server / Data Center instance.

Solution

Method #1 (Mobile)

  • The easiest way to get this information is to scan the /var/log/hipchat/tetra.log for requests sent by an mobile session
  • Run the command below to return a list of unique users who had sessions initiated using mobile device(s).
    • iOS

      admin@hipchat:~$ grep "New request" /var/log/hipchat/tetra.log | grep ":iphone|" | awk -F'from=' '{print $2}' | cut -d: -f1 | sort -u
    • Android

      admin@hipchat:~$ grep "New request" /var/log/hipchat/tetra.log | grep ":android|" | awk -F'from=' '{print $2}' | cut -d: -f1 | sort -u

Note that the user list is limited to the lines logged in the /var/log/hipchat/tetra.log file. You may want to go back to archive of tetra.log to gather more information of the previously logged sessions

Method #2 (Mobile / Desktop / Web Browser)

  • Another alternative is to Use the /var/log/hipchat/web.log to trace for details of the sessions specific to desktop / web / mobile client
  • Run the command below:

    admin@hipchat:~$ grep "=== REQUEST START === url: https://<fqdn>/api/save_preferences" /var/log/hipchat/web.log
  • You will get an output that looks like this:

    2018-05-28T04:31:56.497511+00:00 hipchat web[21562]: api_internal/save_preferences#REQ8DA436 uid-1 1ms [info] === REQUEST START === url: https://hipchat.example.com/api/save_preferences, method: POST, referrer: https://hipchat.example.com/chat, server: , remote_addr: 103.233.242.8, user_agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/605.1.15 (KHTML, like Gecko) HipChat/756 (modern), x_hipchat_request: public
    2018-05-28T04:32:11.137572+00:00 hipchat web[20946]: api_internal/save_preferences#REQD648FD uid-1 1ms [info] === REQUEST START === url: https://hipchat.example.com/api/save_preferences, method: POST, referrer: https://hipchat.example.com/chat, server: , remote_addr: 103.233.242.8, user_agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/605.1.15 (KHTML, like Gecko) HipChat/756 (modern), x_hipchat_request: public
    2018-05-28T04:37:39.539249+00:00 hipchat web[20947]: api_internal/save_preferences#REQD08148 uid-1 1ms [info] === REQUEST START === url: https://hipchat.example.com/api/save_preferences, method: POST, referrer: https://hipchat.example.com/chat, server: , remote_addr: 103.233.242.8, user_agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/605.1.15 (KHTML, like Gecko) HipChat/756 (modern), x_hipchat_request: public
  • The uid-<user_id> will include the information of the user while the user_agent data contains the client and browser types you need. For example: 

    Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36This is Chrome version version 66.0.3359 running on Mac OS X 10_13_3
    Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/604.5.6 (KHTML, like Gecko) HipChat/756 (modern)This is the Mac client
    HipChat/4030003.1665 Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.7.0 Chrome/49.0.2623.111 Safari/537.36, x_hipchat_request: publicThis is the Windows client
    HipChat/3.16.4.18 CFNetwork/897.15 Darwin/17.5.0This is the iOS client version 3.16.4.18

Last modified on Nov 12, 2018

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.