<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Extracting browser statistics from access logs in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Extracting-browser-statistics-from-access-logs/m-p/95765#M6563</link>
    <description>&lt;P&gt;All:&lt;/P&gt;

&lt;P&gt;I am trying to chart browsers used by my app based on the "useragent" field from access_combined (apache logs) in this manner. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="access_combined" useragent!="-" AND useragent!="Apache" AND useragent!="Load-weight" AND useragent!="Java" AND useragent!="Jakarta Commons-HttpClient" | stats count(eval(match(useragent, "Firefox"))) as "Firefox", count(eval(match(useragent, "Chrome"))) as "Chrome", count(eval(match(useragent, "Safari"))) as "Safari", count(eval(match(useragent, "MSIE"))) as "IE", count(eval(NOT match(useragent, "Chrome|Firefox|Safari|MSIE"))) as "Other"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;
&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;The problem is that the actual log entry looks like this:&lt;/P&gt;

&lt;P&gt;For firefox:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;97.76.108.114 - - [11/Jul/2012:08:36:37 -0700] "POST /forgotPassword HTTP/1.1" 200 3799 "https://www.easycareonline.com/forgotPassword" "Mozilla/5.0 (Windows NT 5.1; rv:13.0) Gecko/20100101 Firefox/13.0.1"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For IE:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;97.76.108.114 - - [11/Jul/2012:08:36:37 -0700] "POST /forgotPassword HTTP/1.1" 200 3799 "https://www.easycareonline.com/forgotPassword"  "MSIE 8.0; Windows NT 5.2; Trident/4.0"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;
&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;The useragent entry files these two under OTHER because the ACTUAL VALUE for useragent is :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"Mozilla/5.0 (Windows NT 5.1; rv:13.0) Gecko/20100101 Firefox/13.0.1"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;AND &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"MSIE 8.0; Windows NT 5.2; Trident/4.0"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;
&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;Any ideas on how to go about this ? Maybe regexes ?&lt;/P&gt;

&lt;P&gt;The problem with using field extractions is that there is no set standard for what a UA (User Agent) string should look like, at all. I wonder what the chrome entry looks like (obviously we have none yet)&lt;/P&gt;</description>
    <pubDate>Wed, 11 Jul 2012 15:59:12 GMT</pubDate>
    <dc:creator>asarolkar</dc:creator>
    <dc:date>2012-07-11T15:59:12Z</dc:date>
    <item>
      <title>Extracting browser statistics from access logs</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Extracting-browser-statistics-from-access-logs/m-p/95765#M6563</link>
      <description>&lt;P&gt;All:&lt;/P&gt;

&lt;P&gt;I am trying to chart browsers used by my app based on the "useragent" field from access_combined (apache logs) in this manner. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="access_combined" useragent!="-" AND useragent!="Apache" AND useragent!="Load-weight" AND useragent!="Java" AND useragent!="Jakarta Commons-HttpClient" | stats count(eval(match(useragent, "Firefox"))) as "Firefox", count(eval(match(useragent, "Chrome"))) as "Chrome", count(eval(match(useragent, "Safari"))) as "Safari", count(eval(match(useragent, "MSIE"))) as "IE", count(eval(NOT match(useragent, "Chrome|Firefox|Safari|MSIE"))) as "Other"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;
&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;The problem is that the actual log entry looks like this:&lt;/P&gt;

&lt;P&gt;For firefox:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;97.76.108.114 - - [11/Jul/2012:08:36:37 -0700] "POST /forgotPassword HTTP/1.1" 200 3799 "https://www.easycareonline.com/forgotPassword" "Mozilla/5.0 (Windows NT 5.1; rv:13.0) Gecko/20100101 Firefox/13.0.1"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For IE:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;97.76.108.114 - - [11/Jul/2012:08:36:37 -0700] "POST /forgotPassword HTTP/1.1" 200 3799 "https://www.easycareonline.com/forgotPassword"  "MSIE 8.0; Windows NT 5.2; Trident/4.0"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;
&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;The useragent entry files these two under OTHER because the ACTUAL VALUE for useragent is :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"Mozilla/5.0 (Windows NT 5.1; rv:13.0) Gecko/20100101 Firefox/13.0.1"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;AND &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"MSIE 8.0; Windows NT 5.2; Trident/4.0"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;
&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;Any ideas on how to go about this ? Maybe regexes ?&lt;/P&gt;

&lt;P&gt;The problem with using field extractions is that there is no set standard for what a UA (User Agent) string should look like, at all. I wonder what the chrome entry looks like (obviously we have none yet)&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2012 15:59:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Extracting-browser-statistics-from-access-logs/m-p/95765#M6563</guid>
      <dc:creator>asarolkar</dc:creator>
      <dc:date>2012-07-11T15:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting browser statistics from access logs</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Extracting-browser-statistics-from-access-logs/m-p/95766#M6564</link>
      <description>&lt;P&gt;Because there is such a large number of useragents, it may be worth while using a lookup file to determine the browser, periodically refreshing it when you're getting too many "misses".&lt;/P&gt;

&lt;P&gt;After a bit of a look I stumbled upon this site: &lt;A href="http://browsers.garykeith.com/downloads"&gt;http://browsers.garykeith.com/downloads&lt;/A&gt;, which has a comprehensive list of user-agents and (with a bit of vi trickery) could easily be converted into a lookup that allows you to determine a users browser make &amp;amp; version from the user agent in the event.&lt;/P&gt;

&lt;P&gt;Hope this helps &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jul 2012 14:55:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Extracting-browser-statistics-from-access-logs/m-p/95766#M6564</guid>
      <dc:creator>rturk</dc:creator>
      <dc:date>2012-07-16T14:55:54Z</dc:date>
    </item>
  </channel>
</rss>

