<?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 use outlier command? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-outlier-command/m-p/594792#M207014</link>
    <description>&lt;P&gt;In Splunk documentation for the outlier command, it say:&lt;/P&gt;
&lt;P&gt;"&lt;SPAN&gt;&amp;nbsp;The&amp;nbsp;&lt;/SPAN&gt;transform&lt;SPAN&gt;&amp;nbsp;option truncates the outlying values to the threshold for outliers."&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Would like to understand how it calculates the threshold mentioned above.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;For this SPL below, the total_bytes value of 92000, is replaced with 000244. How does Splunk come up with the value of 244?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| makeresults
| fields - _time
| eval data="101,20220101,3;101,20220102,200;101,20220103,210;101,20220104,220;101,20220105,200;101,20220106,210;101,20220107,220;101,20220108,92000;101,20220109,200;101,20220110,3;"
| makemv delim=";" data
| mvexpand data | eval splitted = split(data,",") | eval day_hour_key=mvindex(splitted,0,0), date=mvindex(splitted,1,1) , total_bytes=mvindex(splitted,2,2)
| fields day_hour_key,total_bytes,date| outlier action=transform mark=true total_bytes | rename total_bytes as transform_total_bytes&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 25 Apr 2022 14:49:07 GMT</pubDate>
    <dc:creator>jeelong</dc:creator>
    <dc:date>2022-04-25T14:49:07Z</dc:date>
    <item>
      <title>How to use outlier command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-outlier-command/m-p/594792#M207014</link>
      <description>&lt;P&gt;In Splunk documentation for the outlier command, it say:&lt;/P&gt;
&lt;P&gt;"&lt;SPAN&gt;&amp;nbsp;The&amp;nbsp;&lt;/SPAN&gt;transform&lt;SPAN&gt;&amp;nbsp;option truncates the outlying values to the threshold for outliers."&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Would like to understand how it calculates the threshold mentioned above.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;For this SPL below, the total_bytes value of 92000, is replaced with 000244. How does Splunk come up with the value of 244?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| makeresults
| fields - _time
| eval data="101,20220101,3;101,20220102,200;101,20220103,210;101,20220104,220;101,20220105,200;101,20220106,210;101,20220107,220;101,20220108,92000;101,20220109,200;101,20220110,3;"
| makemv delim=";" data
| mvexpand data | eval splitted = split(data,",") | eval day_hour_key=mvindex(splitted,0,0), date=mvindex(splitted,1,1) , total_bytes=mvindex(splitted,2,2)
| fields day_hour_key,total_bytes,date| outlier action=transform mark=true total_bytes | rename total_bytes as transform_total_bytes&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2022 14:49:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-outlier-command/m-p/594792#M207014</guid>
      <dc:creator>jeelong</dc:creator>
      <dc:date>2022-04-25T14:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: outlier command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-outlier-command/m-p/594795#M207016</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/245131"&gt;@jeelong&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;did you tried the outlier command without options?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| fields - _time
| eval data="101,20220101,3;101,20220102,200;101,20220103,210;101,20220104,220;101,20220105,200;101,20220106,210;101,20220107,220;101,20220108,92000;101,20220109,200;101,20220110,3;"
| makemv delim=";" data
| mvexpand data 
| eval splitted = split(data,",") 
| eval day_hour_key=mvindex(splitted,0,0), date=mvindex(splitted,1,1) , total_bytes=mvindex(splitted,2,2)
| fields day_hour_key,total_bytes,date
| outlier  
| rename total_bytes as transform_total_bytes&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2022 06:27:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-outlier-command/m-p/594795#M207016</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-04-22T06:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: outlier command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-outlier-command/m-p/594811#M207017</link>
      <description>&lt;P&gt;It looks like this is based on the interquartile range (&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/latest/SearchReference/Outlier#Outlier_options" target="_self"&gt;note param option - https://docs.splunk.com/Documentation/SplunkCloud/latest/SearchReference/Outlier#Outlier_options&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;You can validate this with this example&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| fields - _time
| eval data="101,20220101,3;101,20220102,200;101,20220103,210;101,20220104,220;101,20220105,200;101,20220106,210;101,20220107,220;101,20220108,92000;101,20220109,200;101,20220110,3;"
| makemv delim=";" data
| mvexpand data 
| eval splitted = split(data,",") 
| eval day_hour_key=mvindex(splitted,0,0), date=mvindex(splitted,1,1) , total_bytes=mvindex(splitted,2,2)
| fields day_hour_key,total_bytes,date
| eventstats perc25(total_bytes) as p25 perc75(total_bytes) as p75
| eval iqr=p75-p25
| eval upper=p75+(iqr*1.5)
| outlier action=transform mark=true total_bytes&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 22 Apr 2022 07:33:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-outlier-command/m-p/594811#M207017</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-04-22T07:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: outlier command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-outlier-command/m-p/594980#M207044</link>
      <description>&lt;P&gt;Thanks alot ITWhisperer. You have increased my understanding a great deal.&amp;nbsp;&lt;/P&gt;&lt;P&gt;| makeresults&lt;BR /&gt;| fields - _time&lt;BR /&gt;| eval data="101,20220101,3;101,20220102,200;101,20220103,210;101,20220104,220;101,20220105,200;101,20220106,210;101,20220107,220;101,20220108,92000;101,20220109,200;101,20220110,3;"&lt;BR /&gt;| makemv delim=";" data&lt;BR /&gt;| mvexpand data&lt;BR /&gt;| eval splitted = split(data,",")&lt;BR /&gt;| eval day_hour_key=mvindex(splitted,0,0), date=mvindex(splitted,1,1) , total_bytes=mvindex(splitted,2,2)&lt;BR /&gt;| fields day_hour_key,total_bytes,date&lt;BR /&gt;| eventstats perc25(total_bytes) as p25 perc75(total_bytes) as p75&lt;BR /&gt;| eval iqr=p75-p25&lt;BR /&gt;| eval lower=p25-(iqr*1.5)&lt;BR /&gt;| eval upper=p75+(iqr*1.5)&lt;BR /&gt;| outlier action=transform param=3 mark=true total_bytes&lt;BR /&gt;&lt;BR /&gt;I am still not sure on the results from outlier though.&lt;/P&gt;&lt;P&gt;Given the above, why are the 2 rows with a value of "3" not flagged as an outlier? I would have thought they would be replaced with "174".&lt;/P&gt;&lt;P&gt;Also, if I put in a param of 3, to override the default of 2.5, how does Splunk come up with the number of "250"&amp;nbsp; to replace the "92000"?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2022 23:14:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-outlier-command/m-p/594980#M207044</guid>
      <dc:creator>jeelong</dc:creator>
      <dc:date>2022-04-22T23:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: outlier command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-outlier-command/m-p/594990#M207050</link>
      <description>&lt;P&gt;3 is not flagged because you haven't used uselower=t - it defaults to uselower=f&lt;/P&gt;&lt;P&gt;As for why splunk is picking the values it is, to be honest, I don't know - I just found a relationship that worked for your first example.&lt;/P&gt;&lt;P&gt;Personally, if I don't know how something works, I don't usually use it. For all we know, there might be a bug in the calculation - there certainly something that we are missing.&lt;/P&gt;&lt;P&gt;So, my question to you is, why are you using action=transform?&lt;/P&gt;&lt;P&gt;What do you see the value in transforming the outliers rather than just removing them?&lt;/P&gt;&lt;P&gt;Given that we have our own method of generating a replacement value (albeit a different one to that used by splunk except in one instance), why not use something that is known (that's what I would do until I understood what splunk is doing)?&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Apr 2022 05:59:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-outlier-command/m-p/594990#M207050</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-04-23T05:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: outlier command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-outlier-command/m-p/595318#M207185</link>
      <description>&lt;P&gt;Thanks ITWhisperer.&lt;/P&gt;&lt;P&gt;I have been finding outliers using the that p25 and p75 function to date.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Had created some fairly complex SPL to get the outlier, remove them, and create a baseline for current comparison.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is so we could find spikes in current data compared to a baseline created from previous 365 days.&lt;/P&gt;&lt;P&gt;It works, mostly. But much room for improvement. To this end I have begun looking at Splunk MLTK to see if I could get better results from it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will be diving into "anomalydetection" and "persist" for instance. As I am not a data scientist, I will no doubt be winging it to a large extent.&amp;nbsp;I did want to understand as much as possible what these are doing under the hood. But knew I would have to "trust in the force" to some extent.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I cannot easily decipher what the outlier command is returning then it is not a good sign for when I dive deeper into MLTK.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":sad_but_relieved_face:"&gt;😥&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Oh well. Crash or crash through as they say.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt; Thanks again for your insights.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2022 01:40:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-outlier-command/m-p/595318#M207185</guid>
      <dc:creator>jeelong</dc:creator>
      <dc:date>2022-04-26T01:40:37Z</dc:date>
    </item>
  </channel>
</rss>

