<?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: Help with search to show the top 5 results in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-with-search-to-show-the-top-5-results/m-p/352419#M104313</link>
    <description>&lt;P&gt;This should do it.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="all_eqt" Plant=15 ProcessCode=T DefectCode="*" MachineNumber&amp;lt;26 | stats sum(TotalSquareYards) as "Total Square Yards" by StyleName | top 5 "Total Square Yards" by StyleName | sort StyleName
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 20 Sep 2017 21:03:22 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2017-09-20T21:03:22Z</dc:date>
    <item>
      <title>Help with search to show the top 5 results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-search-to-show-the-top-5-results/m-p/352418#M104312</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index="all_eqt" Plant=15 ProcessCode=T DefectCode="*" MachineNumber&amp;lt;26 | stats sum(TotalSquareYards) as "Total Square Yards" by StyleName | sortStyleName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm trying to limit the data shown on the chart to the top 5 styles with the highest TotalSquareYards&lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2017 20:18:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-search-to-show-the-top-5-results/m-p/352418#M104312</guid>
      <dc:creator>Hppjet</dc:creator>
      <dc:date>2017-09-20T20:18:45Z</dc:date>
    </item>
    <item>
      <title>Re: Help with search to show the top 5 results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-search-to-show-the-top-5-results/m-p/352419#M104313</link>
      <description>&lt;P&gt;This should do it.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="all_eqt" Plant=15 ProcessCode=T DefectCode="*" MachineNumber&amp;lt;26 | stats sum(TotalSquareYards) as "Total Square Yards" by StyleName | top 5 "Total Square Yards" by StyleName | sort StyleName
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Sep 2017 21:03:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-search-to-show-the-top-5-results/m-p/352419#M104313</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-09-20T21:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: Help with search to show the top 5 results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-search-to-show-the-top-5-results/m-p/352420#M104314</link>
      <description>&lt;P&gt;&lt;CODE&gt;| top&lt;/CODE&gt; is problematic here.  it's really designed only to count the occurrences of the field values and give the values themselves. The &lt;CODE&gt;by StyleName&lt;/CODE&gt; will give you the &lt;CODE&gt;top 5&lt;/CODE&gt; of each Stylename, which won't help, since only one record exists for each StyleName, it's not limiting anything.&lt;/P&gt;

&lt;P&gt;Two options...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| sort - "Total Square Yards" 
| head 5
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;...or more succinctly...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| sort 5 - "Total Square Yards" 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Sep 2017 21:17:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-search-to-show-the-top-5-results/m-p/352420#M104314</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-09-20T21:17:59Z</dc:date>
    </item>
  </channel>
</rss>

