

The solution was to lift the core logic from pybrowscap and re-write it myself, busting strings as CSV data instead of files. pybrowscap doesn’t provide it, and it’s actually hard to re-create because they’re using python’s internal CSV buster. I didn’t want to check 58,000 name patterns every time, so I wanted the successful pattern as well. The library returns an object with properties for all the fields in the browscap file. The TA-browscap app uses pybrowscap, which is a Python library for parsing and managing the browscap.csv file. You can imagine, this is quite a challenge. To get an accurate lookup, you need to compare all 58,000 name patterns, and the longest one which matches is the most correct. If you take the first match, you’ll get the wrong information.
#Splunk iis logs windows 7
This name pattern matches FireFox 31 ono Windows 7 x86. The example above matches FireFox 31 on Windows 7 圆4.


The structure of the file is a name pattern for a UA string, followed by all the known properties. They provide the data in a number of formats, the legacy INI file still used by PHP and ASP, and a CSV file, among others. The project is active, and the data is accurate. The Browser Capabilities Project (browscap) is an effort to identify all known User Agent (UA) strings, which regretfully are a total mess. There are installation instructions on the application page at, also in the GitHub repo, so I won’t rehash them here. What started as an hack to cache matches in a separate file has turned into a total fork and re-write of most of the app, and has become TA-browscap_express. The problem is that the browscap file is now 18MB and searching it has become very slow. It’s powered by the browscap project and it works. We’re already getting the IIS logs into Splunk, so with a bit of Googling I found the TA-browscap app by Dave Shpritz. Using a 3rd party analytic tool was totally out of the question, all I had to go on were the IIS logs. We run a SaaS product, and every client is, so I could use the cs_hostname field in the log. I got a requirement to find out what browsers our clients are using.
