PreEmptive Analytics Workbench User Guide

Operating System Mapping

Certain analytics messages include a string identifying the operating system the application was run on; the default OS Indexer uses these strings to determine what OS the application run belongs to.

These strings are often very precise, with specific version or patch numbers, or different brand-names for the "same" underlying OS. In order to provide a user-facing list of operating systems that is more generally useful, the Workbench has a feature that groups precise operating system strings into broader operating system names. This feature is configurable, via a mapping system based around regular expressions.

The mapping file is a JSON file, located at <Installation Folder>\config\OSMappings\default matches.json, but the regular expression syntax is that of .NET.

        "Regex":"Windows Server (\\d{4})( R2)?",
        "Display":"Windows Server $1$2",
        "Regex":"Windows 2003",
        "Display":"Windows Server 2003"
        "Regex":"(?:Mac OS X|Unix) 10\\.(\\d)",
        "Display":"Mac OS X 10.$1"
        "Display":"No match (\"$0\")"

The Regex property is used to match a reported value and the Display format is used to report it. While the syntax is the typical regular expression engine syntax, notice that all escaped values must be double escaped.

You may also have noticed the parenthesis in some of the regular expressions. These are capture groups and they can be referenced in the Display value (via $1, $2, ...) to help reduce the number of mapping rules that are necessary.

Note: each Regex value will be automatically wrapped with additional expression elements. For example, if the original regular expression is Windows Server then the final expression will be ^.*Windows Server.*$. This may be changed in future releases.

For help in devising a .NET regular expression, refer to a reference site and test page.

The order of the entries in the file matters, with entries appearing earlier taking precedence. Therefore, the final entry consisting of blank regular expression (matching any string) acts as a "catch all" that matches when all other entries fail.

Workbench Version 1.2.0. Copyright © 2016 PreEmptive Solutions, LLC