It might be useful to detect and report the types of browser and operating system in use
by your visitors. To collect this data, the Reference session agent allows user-chosen name/value
pairs denoting a regular expression, to be used against the HTTP_USER_AGENT REQ
buffer member.
For example, in the configuration file, you can enter the following section:
#User Agent Parsing (add new members as desired)
UA_Replace=True
IE_All=MSIE\s\d\.\d
Opera_MajMin=Opera/\d\.\d\d
#Operating System Parsing (add new members as desired)
OS_Replace=True
Windows_XP=Windows\sNT\s5\.1
If UA_Replace
is set to True
, then the regular expression on each name/value pair is applied to the user agent string. If a match is found, the value for the name on the left side is inserted into the [appdata]
section as below:
[appdata]
TLT_BROWSER=Opera_MajMin
TLT_OS=Windows_XP
In this manner, you can group OS and Browser types in any way. For example, you can make all possible regular expression matches for Microsoft™ Internet Explorer be represented as IE_ALL
, or you could split them by major and minor version numbers to get finer granularity, as in the following example:
UA_Replace=True
IE_6=MSIE\s6\.\d
IE_7=MSIE\s7\.\d
For reference, the TealeafCaptureSocket-base.cfg
file contains several common regular expressions.