<?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: Find top 20 client IPs that generate the most errors and display individual error status counts for each client IP in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Find-top-20-client-IPs-that-generate-the-most-errors-and-display/m-p/170431#M48761</link>
    <description>&lt;P&gt;You're very close! The thing you're missing is that the &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.3/SearchReference/sort"&gt;sort&lt;/A&gt; command can take a number to give the top N. &lt;/P&gt;

&lt;P&gt;So all you have to do is change your line: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| sort - "Total Errors"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;to:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| sort 20 - "Total Errors"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 23 Jun 2015 18:04:46 GMT</pubDate>
    <dc:creator>acharlieh</dc:creator>
    <dc:date>2015-06-23T18:04:46Z</dc:date>
    <item>
      <title>Find top 20 client IPs that generate the most errors and display individual error status counts for each client IP</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-top-20-client-IPs-that-generate-the-most-errors-and-display/m-p/170429#M48759</link>
      <description>&lt;P&gt;I have only been using Splunk for a few days and couldn't find an answer to this question.&lt;BR /&gt;
I want to find the client IPs that are generating the most errors and display the count of each specific error as well.  However, I want my search to be limited to 20 client IPs (the 20 that generate the most errors).&lt;BR /&gt;
I'm able to get a list of all client IPs right now&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=blah tag=blah AND (status=302 OR status=304 OR status=403 OR status=404 OR status=500) 
| stats count(status) as "Total Errors" count(eval(status=302)) as "302 Count" count(eval(status=304)) as "304 Count" count(eval(status=403)) as "403 Count" count(eval(status=404)) as "404 Count" count(eval(status=500)) as "500 Count" by clientip 
| sort -"Total Errors"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This creates a table like so:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;clientip   | Total Errors | 302 Count | 304 Count | 403 Count | 404 Count | 500 Count 
142.182.28 |      20      |    13     |     5     |     1     |     1     |     0     
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm not showing all the results obviously, but the table lists data for every clientip and every time I try to limit the results, the search is messed up.  I would appreciate any help with what I am doing wrong.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2015 17:46:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-top-20-client-IPs-that-generate-the-most-errors-and-display/m-p/170429#M48759</guid>
      <dc:creator>Kaitrono</dc:creator>
      <dc:date>2015-06-23T17:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: Find top 20 client IPs that generate the most errors and display individual error status counts for each client IP</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-top-20-client-IPs-that-generate-the-most-errors-and-display/m-p/170430#M48760</link>
      <description>&lt;P&gt;How about &lt;CODE&gt;... | sort - "Total Errors" | top limit=20 "Total Errors"&lt;/CODE&gt; ?&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2015 18:04:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-top-20-client-IPs-that-generate-the-most-errors-and-display/m-p/170430#M48760</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-06-23T18:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: Find top 20 client IPs that generate the most errors and display individual error status counts for each client IP</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-top-20-client-IPs-that-generate-the-most-errors-and-display/m-p/170431#M48761</link>
      <description>&lt;P&gt;You're very close! The thing you're missing is that the &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.3/SearchReference/sort"&gt;sort&lt;/A&gt; command can take a number to give the top N. &lt;/P&gt;

&lt;P&gt;So all you have to do is change your line: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| sort - "Total Errors"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;to:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| sort 20 - "Total Errors"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 Jun 2015 18:04:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-top-20-client-IPs-that-generate-the-most-errors-and-display/m-p/170431#M48761</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2015-06-23T18:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: Find top 20 client IPs that generate the most errors and display individual error status counts for each client IP</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-top-20-client-IPs-that-generate-the-most-errors-and-display/m-p/170432#M48762</link>
      <description>&lt;P&gt;Except that using &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.3/SearchReference/top"&gt;top&lt;/A&gt; would eliminate the all of the other fields, "clientip", and the "### Count"&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2015 18:07:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-top-20-client-IPs-that-generate-the-most-errors-and-display/m-p/170432#M48762</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2015-06-23T18:07:53Z</dc:date>
    </item>
    <item>
      <title>Re: Find top 20 client IPs that generate the most errors and display individual error status counts for each client IP</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Find-top-20-client-IPs-that-generate-the-most-errors-and-display/m-p/170433#M48763</link>
      <description>&lt;P&gt;Thank you!  I was not aware sort could take that parameter and this worked.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2015 18:20:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Find-top-20-client-IPs-that-generate-the-most-errors-and-display/m-p/170433#M48763</guid>
      <dc:creator>Kaitrono</dc:creator>
      <dc:date>2015-06-23T18:20:21Z</dc:date>
    </item>
  </channel>
</rss>

