<?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 can I keep only n% of results from a search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-keep-only-n-of-results-from-a-search/m-p/66775#M16651</link>
    <description>&lt;P&gt;Awesome! I hadn't managed to find any reasonable examples of 'where', but that's exactly what I need. Thanks!&lt;/P&gt;</description>
    <pubDate>Fri, 08 Oct 2010 07:37:55 GMT</pubDate>
    <dc:creator>nonspecialist</dc:creator>
    <dc:date>2010-10-08T07:37:55Z</dc:date>
    <item>
      <title>How can I keep only n% of results from a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-keep-only-n-of-results-from-a-search/m-p/66773#M16649</link>
      <description>&lt;P&gt;I have a set of web page performance measurements spanning quite some time, generated by an external monitoring provider. I want to be able to find the mean page performance after removing spikes caused by external factors out of our control, and am thinking along the lines of using a truncated mean as a best measure of central tendency but am having problems with the implementation.&lt;/P&gt;

&lt;P&gt;Here's my thinking so far:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;find all page render times for the past 7 days&lt;/LI&gt;
&lt;LI&gt;order by render time&lt;/LI&gt;
&lt;LI&gt;remove the top and bottom 2.5%&lt;/LI&gt;
&lt;LI&gt;calculate truncated mean from remaining values&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;I can calculate how many values I should be removing easily, but can't work out how to actually remove them. If there's a better way, I'd love to know it!&lt;/P&gt;

&lt;P&gt;My query string (not yet working properly) so far is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;startdaysago=7 monitorid=&amp;lt;foo&amp;gt; | eventstats count(rendertime) as nresults | eval nkeep=nresults-ceil(nresults*0.05) | sort 0 -rendertime | head nkeep
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but of course head can't take a parameter that's not an integer.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2010 06:26:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-keep-only-n-of-results-from-a-search/m-p/66773#M16649</guid>
      <dc:creator>nonspecialist</dc:creator>
      <dc:date>2010-10-08T06:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: How can I keep only n% of results from a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-keep-only-n-of-results-from-a-search/m-p/66774#M16650</link>
      <description>&lt;P&gt;Have you considered using &lt;CODE&gt;outlier&lt;/CODE&gt; to get rid of the edge cases?&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;A href="http://www.splunk.com/base/Documentation/4.1.5/SearchReference/Outlier" rel="nofollow"&gt;http://www.splunk.com/base/Documentation/4.1.5/SearchReference/Outlier&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;Alternately, how about this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;startdaysago=7 monitorid=&amp;lt;foo&amp;gt; 
| eventstats count(rendertime) as nresults
| eval low_clipping=(nresults*0.025)
| eval high_clipping=nresults-low_clipping
| sort rendertime
| streamstats count as sequence_number
| where sequence_number&amp;gt;low_clipping AND sequence_number&amp;lt;high_clipping
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Oct 2010 06:33:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-keep-only-n-of-results-from-a-search/m-p/66774#M16650</guid>
      <dc:creator>southeringtonp</dc:creator>
      <dc:date>2010-10-08T06:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: How can I keep only n% of results from a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-keep-only-n-of-results-from-a-search/m-p/66775#M16651</link>
      <description>&lt;P&gt;Awesome! I hadn't managed to find any reasonable examples of 'where', but that's exactly what I need. Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2010 07:37:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-keep-only-n-of-results-from-a-search/m-p/66775#M16651</guid>
      <dc:creator>nonspecialist</dc:creator>
      <dc:date>2010-10-08T07:37:55Z</dc:date>
    </item>
  </channel>
</rss>

