I searched for the name and version of the browser, the name and OS version from the User Agent field from the IIS log file through a log parser request.
Since the User-Agent string has a different format for each browser and device, how can I get the name and version of the browser exactly from each line through a log parser request? Actually going to store the full UA row in the db table. That is, any other function available in SQL to get the browser and version number from the stored field value?
I tried this query to find the browser name:
SELECT top 100 case strcnt(cs(user-agent), 'Firefox') when 1 THEN 'Firefox' else case strcnt(cs(user-agent), 'MSIE+6') when 1 THEN 'IE 6' else case strcnt(cs(user-agent), 'MSIE+7') when 1 THEN 'IE 7' else case strcnt(cs(user-agent), 'Chrome') when 1 THEN 'Chrome' else case strcnt(cs(user-agent), 'MSIE ') when 1 THEN 'IE' else case strcnt(cs(user-agent), 'Safari ') when 1 THEN 'Safari' else case strcnt(cs(user-agent), 'Opera ') when 1 THEN 'Opera' ELSE 'Unknown' End End End End End End End as Browser
Is there any other function available in Log Parser or SQL to get the browser name? And also how to get the browser version?
sql-server iis logparser
user1905397
source share