Understanding browser usage from transaction logs
Every user transaction is logged into the syslog_transaction table. In addition to the URL and the timing statistics of the transaction, the platform also records a user agent string. This string identifies the browser and certain system details of the user. A user agent can also be used to define programs (or agents) other than a browser, such as a download manager or a bot.
Viewing user agent information
- Navigate to one of the following:
- System Logs > Transactions (All user) in the Application Navigator
- URL /syslog_transaction_list.do?sysparm_filter_only=true
Note: The table itself contains a large amount of records so the usage of the sysparm_filter_only parameter is to navigate to the table without bringing back any records until a search/filter is performed.
- In the list view, configure the form layout to add the User agent field.
This enables you to filter or report on the field.
Understanding a user agent string
Following are some examples of how to read a user agent string.
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0
Internet Explorer 11:
Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko
There are 4 common components in the user agent string:
- Mozilla/5.0 is the general token that says the browser is Mozilla compatible and is common to almost every browser today. Internet Explorer maintains this for legacy purposes.
- Platform describes the native platform the browser is running on (for example, Windows, Mac, Linux, or Android) and whether or not it is a mobile phone.
- Gecko indicates that the browser is based on Gecko. This is new for IE11 and is used to indicate improved consistency with other browsers.
- The version information is expressed differently among the browsers.
Following are some user agent strings for other browsers that ServiceNow supports:
Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_5_8; ja-jp) AppleWebKit/533.20.25 (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27
Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2224.3 Safari/537.36
As you can see, the four components (Mozilla, platform, gecko, and version) consistently appear, however the overall user agent strings do differ between the browsers.
Decoding the user agent strings
User agent strings are presented in different formats by the various browsers. To understand the user agent strings for each browser, view the browser documentation.
- Internet Explorer: https://msdn.microsoft.com/en-us/library/ms537503(v=vs.85).aspx
- Firefox: https://developer.mozilla.org/en-US/docs/Web/HTTP/Gecko_user_agent_string_reference
- Chrome: https://developer.chrome.com/multidevice/user-agent
- Additionally, try http://useragentstring.com/. Add a user agent string, and the browser version and analysis is presented.
This is useful for determining the typical browser usage on which you may want to report. Because the syslog_transaction table is rotated, this table will not go back far and is not safe (for performance reasons) to report on directly. However, you can access the application log files at System Logs > Utilities > Node Log File Browser and identify the user agent strings for the transactions that take place.