<?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 How to limit the number of bars in a bar graph in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-number-of-bars-in-a-bar-graph/m-p/323129#M96414</link>
    <description>&lt;P&gt;I have a query that produces a bar graph of the number of hits in a page. I want to limit this to the top 5-10 values, but I can't seem to get either the limit or top function to do what I need. What am I missing here?&lt;/P&gt;

&lt;P&gt;index=  sourcetype=source= pageURL=&amp;lt; dynamic field input &amp;gt;| stats count as PageHit by uniqueID | stats count as UserCount by PageHit | sort PageHit&lt;/P&gt;

&lt;P&gt;Adding limit or top cannot seem to get the same graph as the full query produces, and just removes the small values.&lt;/P&gt;</description>
    <pubDate>Wed, 06 Dec 2017 20:13:51 GMT</pubDate>
    <dc:creator>brajaram</dc:creator>
    <dc:date>2017-12-06T20:13:51Z</dc:date>
    <item>
      <title>How to limit the number of bars in a bar graph</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-number-of-bars-in-a-bar-graph/m-p/323129#M96414</link>
      <description>&lt;P&gt;I have a query that produces a bar graph of the number of hits in a page. I want to limit this to the top 5-10 values, but I can't seem to get either the limit or top function to do what I need. What am I missing here?&lt;/P&gt;

&lt;P&gt;index=  sourcetype=source= pageURL=&amp;lt; dynamic field input &amp;gt;| stats count as PageHit by uniqueID | stats count as UserCount by PageHit | sort PageHit&lt;/P&gt;

&lt;P&gt;Adding limit or top cannot seem to get the same graph as the full query produces, and just removes the small values.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2017 20:13:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-number-of-bars-in-a-bar-graph/m-p/323129#M96414</guid>
      <dc:creator>brajaram</dc:creator>
      <dc:date>2017-12-06T20:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit the number of bars in a bar graph</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-number-of-bars-in-a-bar-graph/m-p/323130#M96415</link>
      <description>&lt;P&gt;Doing &lt;CODE&gt;| sort PageHit&lt;/CODE&gt; will, by default, sort from lowest values to highest values. If you want the top five, try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index= sourcetype=source= pageURL=&amp;lt; dynamic field input &amp;gt;
| stats count as PageHit by uniqueID 
| stats count as UserCount by PageHit 
| sort -PageHit
| head 5
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;By using &lt;CODE&gt;| sort -PageHit&lt;/CODE&gt; instead, you will reverse the sorting order, and then &lt;CODE&gt;|head 5&lt;/CODE&gt; will limit to the first five items. &lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2017 20:21:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-number-of-bars-in-a-bar-graph/m-p/323130#M96415</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2017-12-06T20:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit the number of bars in a bar graph</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-number-of-bars-in-a-bar-graph/m-p/323131#M96416</link>
      <description>&lt;P&gt;@elliotproebstel - That will work fine, but this is more succinct...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| sort 5 - PageHit
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Dec 2017 21:53:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-number-of-bars-in-a-bar-graph/m-p/323131#M96416</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-12-06T21:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit the number of bars in a bar graph</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-number-of-bars-in-a-bar-graph/m-p/323132#M96417</link>
      <description>&lt;P&gt;Ohh, didn't realize that was an option! Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2017 21:57:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-number-of-bars-in-a-bar-graph/m-p/323132#M96417</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2017-12-06T21:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit the number of bars in a bar graph</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-number-of-bars-in-a-bar-graph/m-p/323133#M96418</link>
      <description>&lt;P&gt;Thanks! I didn't even know head was a solution, worked fine for me.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2017 22:01:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-number-of-bars-in-a-bar-graph/m-p/323133#M96418</guid>
      <dc:creator>brajaram</dc:creator>
      <dc:date>2017-12-06T22:01:32Z</dc:date>
    </item>
  </channel>
</rss>

