<?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 Filter out outliers in stats command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Filter-out-outliers-in-stats-command/m-p/130767#M35632</link>
    <description>&lt;P&gt;So I am trying to filter out outliers using the 3 sigma rule across some transactions. My search is as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;blah... blah... blah...
| eval durationMins = (duration / 60) 
| appendpipe [stats median(durationMins) as Med avg(durationMins) as Avrg stdev(durationMins) as Stddev max(durationMins) as Maxm] 
| eval threeSigmaLimit = (Avrg + (Stddev * 3))
| where durationMins &amp;lt; threeSigmaLimit
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If i remove the appendpipe command and the eval and where stuff at the end, i get a table with the correct values, but I want to store the average and standard deviation, perform the eval statement, and filter out events where the duration of the transaction is greater than threeSigmaLimit &lt;EM&gt;on each event&lt;/EM&gt;...&lt;/P&gt;

&lt;P&gt;The above command doesn't work.... I can't even see the Med, Avrg, Stddev, and Maxm fields in the Events tab in verbose mode....&lt;/P&gt;

&lt;P&gt;Any ideas?&lt;/P&gt;</description>
    <pubDate>Fri, 21 Nov 2014 22:58:03 GMT</pubDate>
    <dc:creator>nterry</dc:creator>
    <dc:date>2014-11-21T22:58:03Z</dc:date>
    <item>
      <title>Filter out outliers in stats command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-out-outliers-in-stats-command/m-p/130767#M35632</link>
      <description>&lt;P&gt;So I am trying to filter out outliers using the 3 sigma rule across some transactions. My search is as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;blah... blah... blah...
| eval durationMins = (duration / 60) 
| appendpipe [stats median(durationMins) as Med avg(durationMins) as Avrg stdev(durationMins) as Stddev max(durationMins) as Maxm] 
| eval threeSigmaLimit = (Avrg + (Stddev * 3))
| where durationMins &amp;lt; threeSigmaLimit
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If i remove the appendpipe command and the eval and where stuff at the end, i get a table with the correct values, but I want to store the average and standard deviation, perform the eval statement, and filter out events where the duration of the transaction is greater than threeSigmaLimit &lt;EM&gt;on each event&lt;/EM&gt;...&lt;/P&gt;

&lt;P&gt;The above command doesn't work.... I can't even see the Med, Avrg, Stddev, and Maxm fields in the Events tab in verbose mode....&lt;/P&gt;

&lt;P&gt;Any ideas?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Nov 2014 22:58:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-out-outliers-in-stats-command/m-p/130767#M35632</guid>
      <dc:creator>nterry</dc:creator>
      <dc:date>2014-11-21T22:58:03Z</dc:date>
    </item>
    <item>
      <title>Re: Filter out outliers in stats command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-out-outliers-in-stats-command/m-p/130768#M35633</link>
      <description>&lt;P&gt;Change &lt;CODE&gt;stats&lt;/CODE&gt; to &lt;CODE&gt;eventstats&lt;/CODE&gt;. Furthermore, you don't need the appendpipe.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval durationMins = (duration/60)
| eventstats median(durationMins) as Med, avg(durationMins) as Avrg, stdev(durationMins) as StDev, max(durationMins) as Maxm
| eval threeSigmaLimit = (Avrg + (StDev * 3))
| where durationMins &amp;lt; threeSigmaLimit
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Eventstats command documentation &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Eventstats"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Nov 2014 00:23:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-out-outliers-in-stats-command/m-p/130768#M35633</guid>
      <dc:creator>aljohnson_splun</dc:creator>
      <dc:date>2014-11-22T00:23:31Z</dc:date>
    </item>
    <item>
      <title>Re: Filter out outliers in stats command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-out-outliers-in-stats-command/m-p/130769#M35634</link>
      <description>&lt;P&gt;THANK YOU SO MUCH!!!!! I was banging my head against the wall for hours trying to figure this one out....&lt;/P&gt;</description>
      <pubDate>Mon, 24 Nov 2014 20:02:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-out-outliers-in-stats-command/m-p/130769#M35634</guid>
      <dc:creator>nterry</dc:creator>
      <dc:date>2014-11-24T20:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: Filter out outliers in stats command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-out-outliers-in-stats-command/m-p/130770#M35635</link>
      <description>&lt;P&gt;Quick question, do the fields Med, Avrg, etc  contain their corresponding stats values after performing the where clause, or before. &lt;/P&gt;

&lt;P&gt;If before, would I pipe it to this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...
| where durationMins &amp;lt; threeSigmaLimit
| stats median(durationMins) as "Median Duration" avg(durationMins) as "Average Duration" stdev(durationMins) as "Standard Deviation" max(durationMins) as "Max Duration"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Nov 2014 21:57:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-out-outliers-in-stats-command/m-p/130770#M35635</guid>
      <dc:creator>nterry</dc:creator>
      <dc:date>2014-11-24T21:57:01Z</dc:date>
    </item>
  </channel>
</rss>

