<?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 to use evaluate function across multiple multivalue fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-evaluate-function-across-multiple-multivalue-fields/m-p/313414#M160926</link>
    <description>&lt;P&gt;This answer will give you more than you need but it has EVERYTHING (prepare to do some work) and it doesn't use the black-box "magic" of ML:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/511894/how-to-use-the-timewrap-command-and-set-an-alert-f.html"&gt;https://answers.splunk.com/answers/511894/how-to-use-the-timewrap-command-and-set-an-alert-f.html&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 29 May 2017 14:13:53 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2017-05-29T14:13:53Z</dc:date>
    <item>
      <title>How to use evaluate function across multiple multivalue fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-evaluate-function-across-multiple-multivalue-fields/m-p/313413#M160925</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am trying to create an anomaly detector for unusually high thruputs across all sourcetypes in my Splunk internal logs. I have used the following code to compile a table of the sourcetype by thruput rate(kilobytes/s) by the time :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal
source=*metrics.log
group=*sourcetype*
| xyseries _time,series,kbps
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am using the standard deviation method to determine my threshold to find the outliers for each sourcetype.&lt;/P&gt;

&lt;P&gt;I am using the following code from the Splunk MLTK addon to detect my outliers:&lt;BR /&gt;
&lt;CODE&gt;&lt;BR /&gt;
|evenstats avg("$sourcetype$") as avg stdev("$sourcetype$") as stdev&lt;BR /&gt;
| eval lowerBound=(avg-stdev*20),upperBound=(avg+stdev*20)&lt;BR /&gt;
| eval isOutlier=if('$sourcetype$' &amp;lt; lowerBound OR '$sourcetype$' &amp;gt; upperBound ,1 , 0)&lt;BR /&gt;
| where isOutlier=1&lt;BR /&gt;
&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;But I do not know how to calculate the average and standard deviation of the thruput rate of each sourcetype using the table generated above. I know that this can be done manually by keying in the sourcetypes. But I have over 20 sourcetypes, is there a way to make a loop using SPL that will loop through all sourcetypes and perform the relevant calculations?&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 29 May 2017 09:57:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-evaluate-function-across-multiple-multivalue-fields/m-p/313413#M160925</guid>
      <dc:creator>mngeow</dc:creator>
      <dc:date>2017-05-29T09:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to use evaluate function across multiple multivalue fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-evaluate-function-across-multiple-multivalue-fields/m-p/313414#M160926</link>
      <description>&lt;P&gt;This answer will give you more than you need but it has EVERYTHING (prepare to do some work) and it doesn't use the black-box "magic" of ML:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/511894/how-to-use-the-timewrap-command-and-set-an-alert-f.html"&gt;https://answers.splunk.com/answers/511894/how-to-use-the-timewrap-command-and-set-an-alert-f.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 May 2017 14:13:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-evaluate-function-across-multiple-multivalue-fields/m-p/313414#M160926</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-05-29T14:13:53Z</dc:date>
    </item>
  </channel>
</rss>

