<?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 filter top 3 counts over each group? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-top-3-counts-over-each-group/m-p/168731#M48124</link>
    <description>&lt;P&gt;Thanks, jeffland. It works! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Do you have any idea if I want to search with data model? (|tstats  command)&lt;BR /&gt;
Seem  I can only use raw search now.&lt;/P&gt;</description>
    <pubDate>Thu, 13 Aug 2015 03:19:16 GMT</pubDate>
    <dc:creator>amylala</dc:creator>
    <dc:date>2015-08-13T03:19:16Z</dc:date>
    <item>
      <title>How to filter top 3 counts over each group?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-top-3-counts-over-each-group/m-p/168727#M48120</link>
      <description>&lt;P&gt;Here is data I get after count by Message and Error Code.&lt;/P&gt;

&lt;P&gt;Message ErrorCode   Count&lt;BR /&gt;
Msg1    1000    500&lt;BR /&gt;
Msg1    1001    400&lt;BR /&gt;
Msg1    1002    300&lt;BR /&gt;
Msg1    1003    200&lt;BR /&gt;
Msg1    1004    100&lt;BR /&gt;
Msg2    2000    550&lt;BR /&gt;
Msg2    2001    450&lt;BR /&gt;
Msg2    2002    350&lt;BR /&gt;
Msg2    2003    250&lt;BR /&gt;
Msg2    2004    150&lt;/P&gt;

&lt;P&gt;I want top 3 count of each Msg. How can I get result as below?&lt;BR /&gt;
Message ErrorCode   Count&lt;BR /&gt;
Msg1    1000    500&lt;BR /&gt;
Msg1    1001    400&lt;BR /&gt;
Msg1    1002    300&lt;BR /&gt;
Msg2    2000    550&lt;BR /&gt;
Msg2    2001    450&lt;BR /&gt;
Msg2    2002    350&lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2015 07:52:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-top-3-counts-over-each-group/m-p/168727#M48120</guid>
      <dc:creator>amylala</dc:creator>
      <dc:date>2015-08-12T07:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter top 3 counts over each group?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-top-3-counts-over-each-group/m-p/168728#M48121</link>
      <description>&lt;P&gt;Does this do the trick?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | top limit=3 showperc=f ErrorCode by Message
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Do it instead of &lt;CODE&gt;stats count by Message ErrorCode&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2015 10:34:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-top-3-counts-over-each-group/m-p/168728#M48121</guid>
      <dc:creator>jeffland</dc:creator>
      <dc:date>2015-08-12T10:34:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter top 3 counts over each group?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-top-3-counts-over-each-group/m-p/168729#M48122</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Your current search giving Count by Message and ErrorCode | sort 0 Message -Count | streamstats count as rank by Message | where rank&amp;lt;=3 | fields - rank 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Aug 2015 15:58:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-top-3-counts-over-each-group/m-p/168729#M48122</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-08-12T15:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter top 3 counts over each group?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-top-3-counts-over-each-group/m-p/168730#M48123</link>
      <description>&lt;P&gt;... | sort  Message -count | dedup 3  Message&lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2015 16:03:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-top-3-counts-over-each-group/m-p/168730#M48123</guid>
      <dc:creator>pradeepkumarg</dc:creator>
      <dc:date>2015-08-12T16:03:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter top 3 counts over each group?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-top-3-counts-over-each-group/m-p/168731#M48124</link>
      <description>&lt;P&gt;Thanks, jeffland. It works! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Do you have any idea if I want to search with data model? (|tstats  command)&lt;BR /&gt;
Seem  I can only use raw search now.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2015 03:19:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-top-3-counts-over-each-group/m-p/168731#M48124</guid>
      <dc:creator>amylala</dc:creator>
      <dc:date>2015-08-13T03:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter top 3 counts over each group?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-top-3-counts-over-each-group/m-p/168732#M48125</link>
      <description>&lt;P&gt;Thanks, somesoni2. &lt;BR /&gt;
This is really what I want. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2015 03:30:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-top-3-counts-over-each-group/m-p/168732#M48125</guid>
      <dc:creator>amylala</dc:creator>
      <dc:date>2015-08-13T03:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter top 3 counts over each group?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-top-3-counts-over-each-group/m-p/168733#M48126</link>
      <description>&lt;P&gt;Thanks, gpradeepkumarreddy. &lt;BR /&gt;
This method is more simple.  But It is sort by count after dedup.&lt;BR /&gt;
I need to sort again at the end. &lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2015 03:47:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-top-3-counts-over-each-group/m-p/168733#M48126</guid>
      <dc:creator>amylala</dc:creator>
      <dc:date>2015-08-13T03:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter top 3 counts over each group?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-top-3-counts-over-each-group/m-p/168734#M48127</link>
      <description>&lt;P&gt;Sorry, I don't know why you wouldn't be able to use this with a data model. I must admit though that I don't work with data models a lot.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2015 05:31:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-top-3-counts-over-each-group/m-p/168734#M48127</guid>
      <dc:creator>jeffland</dc:creator>
      <dc:date>2015-08-13T05:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter top 3 counts over each group?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-top-3-counts-over-each-group/m-p/168735#M48128</link>
      <description>&lt;P&gt;Sorry, my mistake, no need to sorting is not changed after dedup&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2015 06:19:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-top-3-counts-over-each-group/m-p/168735#M48128</guid>
      <dc:creator>amylala</dc:creator>
      <dc:date>2015-08-13T06:19:51Z</dc:date>
    </item>
  </channel>
</rss>

