<?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: Get top 3 IP's for each user in top 10 list in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Get-top-3-IP-s-for-each-user-in-top-10-list/m-p/428104#M170689</link>
    <description>&lt;P&gt;This worked perfectly - I didn't know the streamstats command and had to step through your solution to see how it works, very useful thanks.&lt;/P&gt;</description>
    <pubDate>Wed, 19 Jun 2019 10:32:47 GMT</pubDate>
    <dc:creator>splunklearner12</dc:creator>
    <dc:date>2019-06-19T10:32:47Z</dc:date>
    <item>
      <title>Get top 3 IP's for each user in top 10 list</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-top-3-IP-s-for-each-user-in-top-10-list/m-p/428101#M170686</link>
      <description>&lt;P&gt;I have a list of top 10 users, but I also want the top 3 IP addresses used by those users in a table. Some users will have only used 1 IP while other users have sent traffic from more than 3 IP addresses. I can get top 3 IP's per user: "blah | top client_ip by user limit=3" but I can't get it into the top 10 overall users list. Any ideas?&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 15:23:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-top-3-IP-s-for-each-user-in-top-10-list/m-p/428101#M170686</guid>
      <dc:creator>splunklearner12</dc:creator>
      <dc:date>2019-06-18T15:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: Get top 3 IP's for each user in top 10 list</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-top-3-IP-s-for-each-user-in-top-10-list/m-p/428102#M170687</link>
      <description>&lt;P&gt;@splunklearner1234  Below search should work. your base search will be same in subsearch and main search(index=indexname&amp;gt;sourcetype=sourcetypename)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your base search&amp;gt;| stats count as ipcount  by user src|  sort 0  -ipcount| streamstats count as ucount by user| where ucount &amp;lt;=3| append[search &amp;lt;your base search&amp;gt;| top user ]| eventstats sum(count) as sum by user | where sum&amp;gt;0 and ucount&amp;gt;0|sort -sum user| fields - count percent ucount
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Jun 2019 18:19:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-top-3-IP-s-for-each-user-in-top-10-list/m-p/428102#M170687</guid>
      <dc:creator>Vijeta</dc:creator>
      <dc:date>2019-06-18T18:19:49Z</dc:date>
    </item>
    <item>
      <title>Re: Get top 3 IP's for each user in top 10 list</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-top-3-IP-s-for-each-user-in-top-10-list/m-p/428103#M170688</link>
      <description>&lt;P&gt;Hi @splunklearner1234,&lt;/P&gt;

&lt;P&gt;Lots of ways to do this, the easiest is :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | top 3 IP BY users
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;More ways to do so described here :&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/750232/show-top-5-values-in-column-chart.html#comment-753389"&gt;https://answers.splunk.com/answers/750232/show-top-5-values-in-column-chart.html#comment-753389&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Let me know if that helps.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
David&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 18:56:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-top-3-IP-s-for-each-user-in-top-10-list/m-p/428103#M170688</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-06-18T18:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: Get top 3 IP's for each user in top 10 list</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-top-3-IP-s-for-each-user-in-top-10-list/m-p/428104#M170689</link>
      <description>&lt;P&gt;This worked perfectly - I didn't know the streamstats command and had to step through your solution to see how it works, very useful thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2019 10:32:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-top-3-IP-s-for-each-user-in-top-10-list/m-p/428104#M170689</guid>
      <dc:creator>splunklearner12</dc:creator>
      <dc:date>2019-06-19T10:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: Get top 3 IP's for each user in top 10 list</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-top-3-IP-s-for-each-user-in-top-10-list/m-p/524878#M170690</link>
      <description>&lt;P&gt;I'm struggling to adapt this solution to my problem but I feel like it's the closest to what I'm looking for.&lt;/P&gt;&lt;P&gt;I'm simply trying to get the top 10 src_ips in bytes of web usage, then the top 10 sites each of those src_ips goes to.&lt;/P&gt;&lt;P&gt;My current solution is close but I can't seem to get to it just listing the top 10 sites for each IP, it seems to be doing the top sites overall and then spreading them over the src ips.&lt;/P&gt;&lt;P&gt;index=proxy bytes&amp;gt;0&lt;BR /&gt;| fields src domain bytes&lt;BR /&gt;|stats sum(bytes) AS totalbytes&amp;nbsp; by domain,src&lt;BR /&gt;|sort -totalbytes&amp;nbsp; | head 50&lt;BR /&gt;|stats list(domain) as Domain, list(totalbytes) AS Total BY&amp;nbsp; src&lt;BR /&gt;| sort -Total&lt;/P&gt;&lt;P&gt;I had to do the "head 50"&amp;nbsp; because when I did head 10, i was only getting the top 10 domains in terms of bytes transferred and that was usually over just 3 or 4 IPs.&amp;nbsp; By doing head 50, i was getting more domains to spread over more IPs but still not exactly what I wanted which would be 10 IPs and the top 10 sites for each IP.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2020 15:01:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-top-3-IP-s-for-each-user-in-top-10-list/m-p/524878#M170690</guid>
      <dc:creator>sjbriggs</dc:creator>
      <dc:date>2020-10-15T15:01:50Z</dc:date>
    </item>
  </channel>
</rss>

