<?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: stats for user internet traffic in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/stats-for-user-internet-traffic/m-p/73412#M18388</link>
    <description>&lt;P&gt;If I understand you correctly, this should do what you want&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your_search | stats c AS Requests mode(URL) AS Most_Popular by User, Category | sort - Requests | dedup 2 Category | sort Category
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps,&lt;/P&gt;

&lt;P&gt;Kristian&lt;/P&gt;</description>
    <pubDate>Fri, 17 Feb 2012 14:09:07 GMT</pubDate>
    <dc:creator>kristian_kolb</dc:creator>
    <dc:date>2012-02-17T14:09:07Z</dc:date>
    <item>
      <title>stats for user internet traffic</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-for-user-internet-traffic/m-p/73410#M18386</link>
      <description>&lt;P&gt;I am trying to write a query that filters our users' network traffic.  I would like the query to return information on the top 2 users in each type of web site category and when available provide the most frequently accessed URL in that category.  Sometimes the URL value is NULL.&lt;/P&gt;

&lt;P&gt;For example, results could be:&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
Count    Category    User    URL&lt;BR /&gt;
27       news        bob     msn.com&lt;BR /&gt;
15       news        sally   news.google.com&lt;BR /&gt;
80       games       joe     gamespot.com&lt;BR /&gt;
33       games       alice   giantbomb.com&lt;BR /&gt;
150      social-net  jill    facebook.com&lt;BR /&gt;
12       social-net  bob     twitter.com&lt;BR /&gt;
60       unknown     joe&lt;BR /&gt;
&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;So far I have come up with this, but it does not return the top two and I know the URL value returned does not necessarily correspond with the user.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search... | stats mode(User) mode(URL) count by Category
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks for any help.&lt;/P&gt;

&lt;P&gt;Here is some sample raw data ("web-browsing" is the Category and the URL exists in the second sample only):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Feb 16 16:14:54 10.10.10.21 Feb 16 16:14:54 1,2012/02/16 16:14:54,000000000,TRAFFIC,end,1,2012/02/16 16:14:53,10.10.10.3,74.125.45.94,216.221.226.40,74.125.45.94,PermitAlloutgoingwithScanning,bob,,web-browsing,vsys1,Trust,Untrust,ethernet1/2,ethernet1/1,syslog,2012/02/16 16:14:53,99723,1,55628,80,5238,80,0x400000,tcp,allow,2157,2157,2157,10,2012/02/16 16:12:27,116,allow-list,0,0,0x0,10.0.0.0-10.255.255.255,United States,0


Feb 16 16:14:54 10.10.10.21 Feb 16 16:14:53 1,2012/02/16 16:14:53,000000000,THREAT,url,1,2012/02/16 16:14:52,10.10.10.4,66.161.82.146,216.221.226.40,66.161.82.146,PermitAlloutgoingwithScanning,sally,,web-browsing,vsys1,Trust,Untrust,ethernet1/2,ethernet1/1,syslog,2012/02/16 16:14:53,52281,1,51046,80,14287,80,0x408000,tcp,alert,"www.cdgnow.com/resources/images/theme/content/secondary-nav-li-a-bg.png",(9999),business-and-economy,informational,client-to-server,0,0x0,10.0.0.0-10.255.255.255,United States,0,text/html
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Feb 2012 22:40:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-for-user-internet-traffic/m-p/73410#M18386</guid>
      <dc:creator>Justin</dc:creator>
      <dc:date>2012-02-16T22:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: stats for user internet traffic</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-for-user-internet-traffic/m-p/73411#M18387</link>
      <description>&lt;P&gt;Can you post some of the raw data that the above results will be drawn from?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2012 23:54:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-for-user-internet-traffic/m-p/73411#M18387</guid>
      <dc:creator>sbrant_tt</dc:creator>
      <dc:date>2012-02-16T23:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: stats for user internet traffic</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-for-user-internet-traffic/m-p/73412#M18388</link>
      <description>&lt;P&gt;If I understand you correctly, this should do what you want&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your_search | stats c AS Requests mode(URL) AS Most_Popular by User, Category | sort - Requests | dedup 2 Category | sort Category
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps,&lt;/P&gt;

&lt;P&gt;Kristian&lt;/P&gt;</description>
      <pubDate>Fri, 17 Feb 2012 14:09:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-for-user-internet-traffic/m-p/73412#M18388</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2012-02-17T14:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: stats for user internet traffic</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-for-user-internet-traffic/m-p/73413#M18389</link>
      <description>&lt;P&gt;Thanks Kristian, that did the trick.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Feb 2012 17:42:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-for-user-internet-traffic/m-p/73413#M18389</guid>
      <dc:creator>Justin</dc:creator>
      <dc:date>2012-02-17T17:42:50Z</dc:date>
    </item>
  </channel>
</rss>

