<?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: How to find the top 10 error codes by each host and display the count in a table? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-top-10-error-codes-by-each-host-and-display-the/m-p/213097#M62486</link>
    <description>&lt;P&gt;Thanks for your response, but with the above query its showing only 10 servers, with the event code &amp;amp; count.&lt;/P&gt;

&lt;P&gt;i need the list of all server with the 10 errors as the column in it.&lt;/P&gt;

&lt;P&gt;Host A  EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode&lt;BR /&gt;
Host B  EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode&lt;BR /&gt;
Host C  EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode&lt;BR /&gt;
Host D  EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode&lt;BR /&gt;
Host E  EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode&lt;BR /&gt;
Host F  EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode&lt;BR /&gt;
Host G  EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode&lt;/P&gt;</description>
    <pubDate>Thu, 10 Nov 2016 09:21:30 GMT</pubDate>
    <dc:creator>SathyaNarayanan</dc:creator>
    <dc:date>2016-11-10T09:21:30Z</dc:date>
    <item>
      <title>How to find the top 10 error codes by each host and display the count in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-top-10-error-codes-by-each-host-and-display-the/m-p/213090#M62479</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have list of servers, I need to find top Event Codes errors for each host, as each host as different Event codes. How to list them in a single table and show the number of Event codes count?&lt;/P&gt;

&lt;P&gt;Eg; The table should be like below&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Host 
acdc   5678    1842   7415
adfdf  3485    7684   1582
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Nov 2016 10:40:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-top-10-error-codes-by-each-host-and-display-the/m-p/213090#M62479</guid>
      <dc:creator>SathyaNarayanan</dc:creator>
      <dc:date>2016-11-07T10:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the top 10 error codes by each host and display the count in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-top-10-error-codes-by-each-host-and-display-the/m-p/213091#M62480</link>
      <description>&lt;P&gt;See if the following works for you:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search here
| stats count by EventCode, host
| sort limit=0 host, - count
| streamstats count as top by host
| where top &amp;lt;= 10
| stats list(EventCode) as EventCode, list(count) as count by host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
J&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2016 11:08:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-top-10-error-codes-by-each-host-and-display-the/m-p/213091#M62480</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-11-07T11:08:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the top 10 error codes by each host and display the count in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-top-10-error-codes-by-each-host-and-display-the/m-p/213092#M62481</link>
      <description>&lt;P&gt;I have edited my answer as per you last example to display top 10 host names and EventCode. Try the following:&lt;/P&gt;

&lt;P&gt;your base search | &lt;STRONG&gt;eval myField= host + " - " + EventCode| top 10 myField showperc=f&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;-----Editing answer again--- Following will give top 10 EventCode counts over all hosts:. Please try and confirm(eventstats will add ECCount field to all existing event which can be used in stats sum command later):&lt;/P&gt;

&lt;P&gt;your base search here &lt;STRONG&gt;| eventstats count as ECCount by EventCode | chart limit=10 userother=f sum(ECCount) over host by EventCode&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2016 14:43:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-top-10-error-codes-by-each-host-and-display-the/m-p/213092#M62481</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2016-11-07T14:43:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the top 10 error codes by each host and display the count in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-top-10-error-codes-by-each-host-and-display-the/m-p/213093#M62482</link>
      <description>&lt;P&gt;When i execute the above command, am getting the results as below&lt;/P&gt;

&lt;P&gt;host     3688 10016 7001 5722 ......................................&lt;BR /&gt;
asdfd      0         0         1        0&lt;BR /&gt;
kjhl          0         1         0        0&lt;BR /&gt;
mk;          1         0         0        0&lt;/P&gt;

&lt;P&gt;It goes on like this&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2016 10:00:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-top-10-error-codes-by-each-host-and-display-the/m-p/213093#M62482</guid>
      <dc:creator>SathyaNarayanan</dc:creator>
      <dc:date>2016-11-09T10:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the top 10 error codes by each host and display the count in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-top-10-error-codes-by-each-host-and-display-the/m-p/213094#M62483</link>
      <description>&lt;P&gt;Sorry but your example doesn't really help as I don't know what the numbers mean. Are they counts? are they event codes?&lt;/P&gt;

&lt;P&gt;Something like this would help:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;HOSTA EventCode1 Count1
HOSTA EventCode2 Count2
....
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Nov 2016 10:23:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-top-10-error-codes-by-each-host-and-display-the/m-p/213094#M62483</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-11-09T10:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the top 10 error codes by each host and display the count in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-top-10-error-codes-by-each-host-and-display-the/m-p/213095#M62484</link>
      <description>&lt;P&gt;Need to show top errors for each host with event code count&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2016 10:35:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-top-10-error-codes-by-each-host-and-display-the/m-p/213095#M62484</guid>
      <dc:creator>SathyaNarayanan</dc:creator>
      <dc:date>2016-11-09T10:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the top 10 error codes by each host and display the count in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-top-10-error-codes-by-each-host-and-display-the/m-p/213096#M62485</link>
      <description>&lt;P&gt;Above query should return result in the following format:&lt;/P&gt;

&lt;P&gt;HOSTA - EventCode1 Count1&lt;BR /&gt;
 HOSTA - EventCode2 Count2&lt;BR /&gt;
 ....&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2016 12:29:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-top-10-error-codes-by-each-host-and-display-the/m-p/213096#M62485</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2016-11-09T12:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the top 10 error codes by each host and display the count in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-top-10-error-codes-by-each-host-and-display-the/m-p/213097#M62486</link>
      <description>&lt;P&gt;Thanks for your response, but with the above query its showing only 10 servers, with the event code &amp;amp; count.&lt;/P&gt;

&lt;P&gt;i need the list of all server with the 10 errors as the column in it.&lt;/P&gt;

&lt;P&gt;Host A  EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode&lt;BR /&gt;
Host B  EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode&lt;BR /&gt;
Host C  EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode&lt;BR /&gt;
Host D  EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode&lt;BR /&gt;
Host E  EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode&lt;BR /&gt;
Host F  EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode&lt;BR /&gt;
Host G  EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2016 09:21:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-top-10-error-codes-by-each-host-and-display-the/m-p/213097#M62486</guid>
      <dc:creator>SathyaNarayanan</dc:creator>
      <dc:date>2016-11-10T09:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the top 10 error codes by each host and display the count in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-top-10-error-codes-by-each-host-and-display-the/m-p/213098#M62487</link>
      <description>&lt;P&gt;I have added a second search query as per your example above. Can you check and confirm whether it works for you or not?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2016 10:23:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-top-10-error-codes-by-each-host-and-display-the/m-p/213098#M62487</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2016-11-10T10:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the top 10 error codes by each host and display the count in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-top-10-error-codes-by-each-host-and-display-the/m-p/213099#M62488</link>
      <description>&lt;P&gt;i tried with your new query, that is also not helping it. &lt;/P&gt;

&lt;P&gt;Thanks for your time&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2016 10:53:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-top-10-error-codes-by-each-host-and-display-the/m-p/213099#M62488</guid>
      <dc:creator>SathyaNarayanan</dc:creator>
      <dc:date>2016-11-10T10:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the top 10 error codes by each host and display the count in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-top-10-error-codes-by-each-host-and-display-the/m-p/213100#M62489</link>
      <description>&lt;P&gt;Do you mean the output is not what you expect or does the query has any issue? Can you share the output?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2016 11:08:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-top-10-error-codes-by-each-host-and-display-the/m-p/213100#M62489</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2016-11-10T11:08:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the top 10 error codes by each host and display the count in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-top-10-error-codes-by-each-host-and-display-the/m-p/213101#M62490</link>
      <description>&lt;P&gt;Based on your answers below I'm guessing this is what you are looking for:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search here
| stats count by EventCode, host
| sort limit=0 host, - count
| streamstats count as top by host
| where top &amp;lt;= 10
| stats list(EventCode) as EventCode by host
| eval EventCode = mvjoin(EventCode, " ")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This would give you a similar output to the one you listed below:&lt;/P&gt;

&lt;P&gt;Host A EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode&lt;BR /&gt;
Host B EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode&lt;BR /&gt;
Host C EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode&lt;BR /&gt;
Host D EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode&lt;BR /&gt;
Host E EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode&lt;BR /&gt;
Host F EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode&lt;BR /&gt;
Host G EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode EventCode&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2016 14:56:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-top-10-error-codes-by-each-host-and-display-the/m-p/213101#M62490</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-11-10T14:56:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the top 10 error codes by each host and display the count in a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-top-10-error-codes-by-each-host-and-display-the/m-p/213102#M62491</link>
      <description>&lt;P&gt;Why not :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... base_search ... | top EventCode by host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Quite simple ... or I missed something ... ?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2016 15:50:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-top-10-error-codes-by-each-host-and-display-the/m-p/213102#M62491</guid>
      <dc:creator>Rocket66</dc:creator>
      <dc:date>2016-11-10T15:50:48Z</dc:date>
    </item>
  </channel>
</rss>

