<?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: Chart Help in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Chart-Help/m-p/296017#M89307</link>
    <description>&lt;P&gt;@Hppjet, after sorting results in descending order of TSY, apply streamstats to count occurrence of ShopOrder field as &lt;CODE&gt;eventcount&lt;/CODE&gt; and apply filter for &lt;CODE&gt;eventcount &amp;lt;10&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="all_eqt" 
| stats sum(TotalSquareYards) as TSY by ShopOrder DefectDescription 
| table ShopOrder DefectDescription TSY 
|  sort - TSY
|  streamstats count as eventcount by ShopOrder
|  where eventcount &amp;lt;= 10
|  chart sum(TSY) over ShopOrder by DefectDescription
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please try out and confirm.&lt;/P&gt;</description>
    <pubDate>Thu, 16 Nov 2017 19:31:58 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2017-11-16T19:31:58Z</dc:date>
    <item>
      <title>Chart Help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-Help/m-p/296016#M89306</link>
      <description>&lt;P&gt;index="all_eqt" | stats sum(TotalSquareYards) as TSY by ShopOrder DefectDescription| table ShopOrder DefectDescription TSY |sort -TSY | head 10 | chart sum(TSY) over ShopOrder by DefectDescription&lt;/P&gt;

&lt;P&gt;I am not able to get the chart to show the top 10 shop orders with TSY instead it just shows the first 10.  Please help.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3885i7EC6F73E719CA7BB/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 19:15:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-Help/m-p/296016#M89306</guid>
      <dc:creator>Hppjet</dc:creator>
      <dc:date>2017-11-16T19:15:40Z</dc:date>
    </item>
    <item>
      <title>Re: Chart Help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-Help/m-p/296017#M89307</link>
      <description>&lt;P&gt;@Hppjet, after sorting results in descending order of TSY, apply streamstats to count occurrence of ShopOrder field as &lt;CODE&gt;eventcount&lt;/CODE&gt; and apply filter for &lt;CODE&gt;eventcount &amp;lt;10&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="all_eqt" 
| stats sum(TotalSquareYards) as TSY by ShopOrder DefectDescription 
| table ShopOrder DefectDescription TSY 
|  sort - TSY
|  streamstats count as eventcount by ShopOrder
|  where eventcount &amp;lt;= 10
|  chart sum(TSY) over ShopOrder by DefectDescription
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please try out and confirm.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 19:31:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-Help/m-p/296017#M89307</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-11-16T19:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: Chart Help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-Help/m-p/296018#M89308</link>
      <description>&lt;P&gt;Do you want to show top 10 TSY for each ShopOrder?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 19:34:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-Help/m-p/296018#M89308</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-11-16T19:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: Chart Help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-Help/m-p/296019#M89309</link>
      <description>&lt;P&gt;I want to show the top 10 shop orders.  Then show the sum of the parts that make up the shop order.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 19:40:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-Help/m-p/296019#M89309</guid>
      <dc:creator>Hppjet</dc:creator>
      <dc:date>2017-11-16T19:40:30Z</dc:date>
    </item>
    <item>
      <title>Re: Chart Help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-Help/m-p/296020#M89310</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="all_eqt" 
| stats sum(TotalSquareYards) as TSY by ShopOrder DefectDescription
| appendpipe [| stats sum(TSY) as TSY by ShortOrder | sort 10 -TSY | eval isTop10="Y" | eval isTotalRow="Y" ]
| eventstats values(isTop10) as isTop10 by ShortOrder | where isTop10="Y" AND NOT isTotalRow="Y"
| chart sum(TSY) over ShopOrder by DefectDescription
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The appendpipe subsearch will get total TSY by ShortOrder, get top 10 from that and flag those ShortOrders. The eventstats will apply the flag on all matching (top 10) ShortOrders. The where clause will just remove all unnecessary results (not in top 10 and those appendpipe results).&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2017 20:03:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-Help/m-p/296020#M89310</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-11-16T20:03:20Z</dc:date>
    </item>
    <item>
      <title>Re: Chart Help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-Help/m-p/296021#M89311</link>
      <description>&lt;P&gt;@Hppjet, were you able to try out any of the answers below? Is your issue resolved?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2017 04:33:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-Help/m-p/296021#M89311</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-11-24T04:33:59Z</dc:date>
    </item>
  </channel>
</rss>

