title: Get browser name and version from IIS log file in Log Parser
body: <p>I am looking for find out the browser name and version, OS name and version from User Agent field of IIS log file through Log parser query.</p>
  
  <p>As the User-Agent string has different format for every browser and device how could I get the browser name and version exactly from each string through a log parser query? Actually going to store full UA string in db table. So is any other function available in SQL to get browser and version number from the stored field value? </p>
  
  <p>I tried this query to find browser name:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>Is there any other function available in Log Parser or in SQL to get browser name? And also how to get browser version?</p>