<?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 Re: Browser Usage Statistics in Security</title>
    <link>https://community.splunk.com/t5/Security/Browser-Usage-Statistics/m-p/19024#M619</link>
    <description>&lt;P&gt;,did anyone get this to work?&lt;BR /&gt;
Regex: syntax error in subpattern name (missing terminator) &lt;/P&gt;</description>
    <pubDate>Thu, 02 Mar 2017 20:51:45 GMT</pubDate>
    <dc:creator>totalnet32</dc:creator>
    <dc:date>2017-03-02T20:51:45Z</dc:date>
    <item>
      <title>Browser Usage Statistics</title>
      <link>https://community.splunk.com/t5/Security/Browser-Usage-Statistics/m-p/19016#M611</link>
      <description>&lt;P&gt;Hello Splunkers,&lt;/P&gt;

&lt;P&gt;I am new to Splunk and I'm having a hard time generating what should be a simple report.  I'd like to produce a pie chart that shows browser usage by major browser (IE, Firefox, Chrome, Safari, etc.).&lt;/P&gt;

&lt;P&gt;I started with the following mess of a query, but it doesn't give me "chartable" results:&lt;/P&gt;

&lt;P&gt;sourcetype="access" useragent!="-" &lt;BR /&gt;
  AND useragent!="Apache*" &lt;BR /&gt;
  AND useragent!="Load-weight*" &lt;BR /&gt;
  AND useragent!="Java*" &lt;BR /&gt;
  AND useragent!="Jakarta Commons-HttpClient*" &lt;BR /&gt;
  AND useragent!="Mozilla/4.0 &lt;A href="https://community.splunk.com/WinNT;%20I" target="_blank"&gt;en&lt;/A&gt;"&lt;BR /&gt;
| table SessionCookie, useragent &lt;BR /&gt;
| dedup SessionCookie &lt;BR /&gt;
| stats &lt;BR /&gt;
  count(eval(match(useragent, "Firefox"))) as "Firefox", &lt;BR /&gt;
  count(eval(match(useragent, "Chrome"))) as "Chrome", &lt;BR /&gt;
  count(eval(match(useragent, "Safari"))) as "Safari", &lt;BR /&gt;
  count(eval(match(useragent, "MSIE"))) as "IE", &lt;BR /&gt;
  count(eval(NOT match(useragent, "Chrome|Firefox|Safari|MSIE"))) as "Other"&lt;/P&gt;

&lt;P&gt;Does anyone have an example query that could get me to my pie chart?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Mark&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 10:07:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Browser-Usage-Statistics/m-p/19016#M611</guid>
      <dc:creator>mapugh73</dc:creator>
      <dc:date>2020-09-28T10:07:31Z</dc:date>
    </item>
    <item>
      <title>Re: Browser Usage Statistics</title>
      <link>https://community.splunk.com/t5/Security/Browser-Usage-Statistics/m-p/19017#M612</link>
      <description>&lt;P&gt;Could you provide more details on what the current result is and how it differs from the desired result?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2011 22:09:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Browser-Usage-Statistics/m-p/19017#M612</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2011-11-17T22:09:52Z</dc:date>
    </item>
    <item>
      <title>Re: Browser Usage Statistics</title>
      <link>https://community.splunk.com/t5/Security/Browser-Usage-Statistics/m-p/19018#M613</link>
      <description>&lt;P&gt;since the useragent is being extracted already, you should be able to do a &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="access" useragent!="-" 
  AND useragent!="Apache" 
  AND useragent!="Load-weight" 
  AND useragent!="Java" 
  AND useragent!="Jakarta Commons-HttpClient" 
  AND useragent!="Mozilla/4.0 [en] (WinNT; I)"
| table SessionCookie, useragent 
| dedup SessionCookie 
| stats count by useragent
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You also might want to add a case that if useragent does not match Chrome, Firefox, Safari, or MSIE, to call useragent as "Other"&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2011 22:48:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Browser-Usage-Statistics/m-p/19018#M613</guid>
      <dc:creator>Genti</dc:creator>
      <dc:date>2011-11-17T22:48:08Z</dc:date>
    </item>
    <item>
      <title>Re: Browser Usage Statistics</title>
      <link>https://community.splunk.com/t5/Security/Browser-Usage-Statistics/m-p/19019#M614</link>
      <description>&lt;P&gt;I use a search like this to return the top 50 browsers:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=access_logs
| fields + user_agent
| rex field=user_agent "((?&amp;amp;lt;browser_ff&amp;amp;gt;Firefox\S+)|(?&amp;amp;lt;browser_ie&amp;amp;gt;MSIE [\d\.]+)|(?&amp;amp;lt;browser_opera&amp;amp;gt;Opera)|(?&amp;amp;lt;browser_chrome&amp;amp;gt;Chrome)|(?&amp;amp;lt;browser_safari&amp;amp;gt;Safari)|(?&amp;amp;lt;browser_java&amp;amp;gt;Java\S+)|(?&amp;amp;lt;browser_nagios&amp;amp;gt;nagios\S+)|(?&amp;amp;lt;browser_nessus&amp;amp;gt;[Nn][Ee][Ss][Ss][Uu][Ss])|(?&amp;amp;lt;browser_apache&amp;amp;gt;Apache\S+))"
| eval browser_none=if(user_agent=="-","None","")
| fillnull value="" browser_ff browser_ie browser_chrome browser_safari browser_opera browser_java browser_nagios browser_nessus broswer_none browser_apache
| eval browser = browser_ff.browser_ie.browser_chrome.browser_safari.browser_opera.browser_java.browser_nagios.browser_nessus.browser_none.browser_apache
| top 50 browser
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Nov 2011 23:57:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Browser-Usage-Statistics/m-p/19019#M614</guid>
      <dc:creator>joshd</dc:creator>
      <dc:date>2011-11-17T23:57:50Z</dc:date>
    </item>
    <item>
      <title>Re: Browser Usage Statistics</title>
      <link>https://community.splunk.com/t5/Security/Browser-Usage-Statistics/m-p/19020#M615</link>
      <description>&lt;P&gt;Justin Azoff has posted a very useful user agent translator script/custom splunk command here:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://github.com/JustinAzoff/splunk-scripts/blob/master/ua2os.py"&gt;https://github.com/JustinAzoff/splunk-scripts/blob/master/ua2os.py&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Translates the horrible useragent string into browser, os type and architecture. It works very well.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2011 10:42:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Browser-Usage-Statistics/m-p/19020#M615</guid>
      <dc:creator>Glenn</dc:creator>
      <dc:date>2011-12-08T10:42:15Z</dc:date>
    </item>
    <item>
      <title>Re: Browser Usage Statistics</title>
      <link>https://community.splunk.com/t5/Security/Browser-Usage-Statistics/m-p/19021#M616</link>
      <description>&lt;P&gt;I certainly like the looks of the script, I just have no idea what to do with it.  Will you please assist?&lt;/P&gt;</description>
      <pubDate>Fri, 20 Apr 2012 13:51:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Browser-Usage-Statistics/m-p/19021#M616</guid>
      <dc:creator>brettski</dc:creator>
      <dc:date>2012-04-20T13:51:40Z</dc:date>
    </item>
    <item>
      <title>Re: Browser Usage Statistics</title>
      <link>https://community.splunk.com/t5/Security/Browser-Usage-Statistics/m-p/19022#M617</link>
      <description>&lt;P&gt;This query is erroring out currently.&lt;/P&gt;</description>
      <pubDate>Sun, 29 Jul 2012 20:40:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Browser-Usage-Statistics/m-p/19022#M617</guid>
      <dc:creator>asarolkar</dc:creator>
      <dc:date>2012-07-29T20:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: Browser Usage Statistics</title>
      <link>https://community.splunk.com/t5/Security/Browser-Usage-Statistics/m-p/19023#M618</link>
      <description>&lt;P&gt;Hi. Did you ever get around to getting Splunk to run this python script ?&lt;/P&gt;</description>
      <pubDate>Sun, 29 Jul 2012 21:36:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Browser-Usage-Statistics/m-p/19023#M618</guid>
      <dc:creator>asarolkar</dc:creator>
      <dc:date>2012-07-29T21:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: Browser Usage Statistics</title>
      <link>https://community.splunk.com/t5/Security/Browser-Usage-Statistics/m-p/19024#M619</link>
      <description>&lt;P&gt;,did anyone get this to work?&lt;BR /&gt;
Regex: syntax error in subpattern name (missing terminator) &lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2017 20:51:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Browser-Usage-Statistics/m-p/19024#M619</guid>
      <dc:creator>totalnet32</dc:creator>
      <dc:date>2017-03-02T20:51:45Z</dc:date>
    </item>
    <item>
      <title>Re: Browser Usage Statistics</title>
      <link>https://community.splunk.com/t5/Security/Browser-Usage-Statistics/m-p/19025#M620</link>
      <description>&lt;P&gt;This question is more than five years old.  Please post a new question.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2017 22:04:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Browser-Usage-Statistics/m-p/19025#M620</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-03-02T22:04:59Z</dc:date>
    </item>
    <item>
      <title>Re: Browser Usage Statistics</title>
      <link>https://community.splunk.com/t5/Security/Browser-Usage-Statistics/m-p/19026#M621</link>
      <description>&lt;P&gt;If you're copying/pasting the search I posted and answer for back in 2011 then the HTML chars in the regex are breaking it (dont know why those are there)... but also note there are addons and custom commands people have developed since there that are a bit more detailed/flexible than this post was...&lt;/P&gt;

&lt;P&gt;If you want to use this search then it should be like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=access_logs
 | fields + user_agent
 | rex field=user_agent "((?&amp;lt;browser_ff&amp;gt;Firefox\S+)|(?&amp;lt;browser_ie&amp;gt;MSIE [\d\.]+)|(?&amp;lt;browser_opera&amp;gt;Opera)|(?&amp;lt;browser_chrome&amp;gt;Chrome)|(?&amp;lt;browser_safari&amp;gt;Safari)|(?&amp;lt;browser_java&amp;gt;Java\S+)|(?&amp;lt;browser_nagios&amp;gt;nagios\S+)|(?&amp;lt;browser_nessus&amp;gt;[Nn][Ee][Ss][Ss][Uu][Ss])|(?&amp;lt;browser_apache&amp;gt;Apache\S+))"
 | eval browser_none=if(user_agent=="-","None","")
 | fillnull value="" browser_ff browser_ie browser_chrome browser_safari browser_opera browser_java browser_nagios browser_nessus broswer_none browser_apache
 | eval browser = browser_ff.browser_ie.browser_chrome.browser_safari.browser_opera.browser_java.browser_nagios.browser_nessus.browser_none.browser_apache
 | top 50 browser
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Mar 2017 02:19:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Browser-Usage-Statistics/m-p/19026#M621</guid>
      <dc:creator>joshd</dc:creator>
      <dc:date>2017-03-03T02:19:31Z</dc:date>
    </item>
  </channel>
</rss>

