<?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 eval - inconsistent math result in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/eval-inconsistent-math-result/m-p/91888#M23717</link>
    <description>&lt;P&gt;How is it possible that an eval expression which its components total weight is 100, breach that expected value?&lt;BR /&gt;&lt;BR /&gt;
For a given period, I'm getting a result of 101,&lt;BR /&gt;&lt;BR /&gt;
while expression components weights are (it totals to 100)&lt;BR /&gt;&lt;BR /&gt;
100*(0.08 + 0.03 + 0.12 + 0.16 + 0.06 + 0.18 + 0.06 + 0.06 + 0.25)&lt;BR /&gt;&lt;BR /&gt;
and there is not even one component value which exceeds 1.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval TimeoutScore=100*( 
0.08*(bw1sdpSdfPccCsApdex) 
+ 0.03*bw1sdpSdfPccMnCsApdex 
+ 0.12*bw1sdpSdfPccPsApdex 
+ 0.16*(0.5*bw1sdpSdfPpsCsApdex +0.5*bw2sdpSdfPpsCsApdex) 
+ 0.06*(0.5*bw1sdpSdfPpsMnCsApdex +0.5*bw2sdpSdfPpsMnCsApdex)
+ 0.18*(0.5*bw1sdpSdfPpsPsApdex + 0.5*bw2sdpSdfPpsPsApdex)
+ 0.06*(0.5*bw1sdpSdfPpsVisaCsApdex + 0.5*bw2sdpSdfPpsVisaCsApdex) 
+ 0.06*bw1careSdfMnApdex 
+ 0.25*(0.5*bw1sdpSdfSlrApdex + 0.5*bw2sdpSdfSlrApdex))
| stats sum(TimeoutScore) as TimeoutScore sum(bw1sdpSdfPccCsApdex) sum(bw1sdpSdfPccMnCsApdex)     sum(bw1sdpSdfPccPsApdex) sum(bw1sdpSdfPpsCsApdex) sum(bw2sdpSdfPpsCsApdex) sum(bw1sdpSdfPpsMnCsApdex) sum(bw2sdpSdfPpsMnCsApdex) sum(bw1sdpSdfPpsPsApdex) sum(bw2sdpSdfPpsPsApdex) sum(bw1sdpSdfPpsVisaCsApdex) sum(bw2sdpSdfPpsVisaCsApdex) sum(bw1careSdfMnApdex) sum(bw1sdpSdfSlrApdex) sum(bw2sdpSdfSlrApdex)


TimeoutScore    sum(bw1sdpSdfPccCsApdex)    sum(bw1sdpSdfPccMnCsApdex)  sum(bw1sdpSdfPccPsApdex)    sum(bw1sdpSdfPpsCsApdex)    sum(bw2sdpSdfPpsCsApdex)    sum(bw1sdpSdfPpsMnCsApdex)  sum(bw2sdpSdfPpsMnCsApdex)  sum(bw1sdpSdfPpsPsApdex)    sum(bw2sdpSdfPpsPsApdex)    sum(bw1sdpSdfPpsVisaCsApdex)    sum(bw2sdpSdfPpsVisaCsApdex)    sum(bw1careSdfMnApdex)  sum(bw1sdpSdfSlrApdex)  sum(bw2sdpSdfSlrApdex)
101 1   0.854839    0.972727    1   1   1   1   0.975410    1   1   1   0.983871    1   1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;EDIT:&lt;/STRONG&gt;&lt;BR /&gt;
Thanks to kristian.kolb suggestion, this issue was solved replacing  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval TimeoutScore=...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;by&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval TimeoutScore=exact(...)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 12 Apr 2013 09:59:33 GMT</pubDate>
    <dc:creator>splunk_zen</dc:creator>
    <dc:date>2013-04-12T09:59:33Z</dc:date>
    <item>
      <title>eval - inconsistent math result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-inconsistent-math-result/m-p/91888#M23717</link>
      <description>&lt;P&gt;How is it possible that an eval expression which its components total weight is 100, breach that expected value?&lt;BR /&gt;&lt;BR /&gt;
For a given period, I'm getting a result of 101,&lt;BR /&gt;&lt;BR /&gt;
while expression components weights are (it totals to 100)&lt;BR /&gt;&lt;BR /&gt;
100*(0.08 + 0.03 + 0.12 + 0.16 + 0.06 + 0.18 + 0.06 + 0.06 + 0.25)&lt;BR /&gt;&lt;BR /&gt;
and there is not even one component value which exceeds 1.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval TimeoutScore=100*( 
0.08*(bw1sdpSdfPccCsApdex) 
+ 0.03*bw1sdpSdfPccMnCsApdex 
+ 0.12*bw1sdpSdfPccPsApdex 
+ 0.16*(0.5*bw1sdpSdfPpsCsApdex +0.5*bw2sdpSdfPpsCsApdex) 
+ 0.06*(0.5*bw1sdpSdfPpsMnCsApdex +0.5*bw2sdpSdfPpsMnCsApdex)
+ 0.18*(0.5*bw1sdpSdfPpsPsApdex + 0.5*bw2sdpSdfPpsPsApdex)
+ 0.06*(0.5*bw1sdpSdfPpsVisaCsApdex + 0.5*bw2sdpSdfPpsVisaCsApdex) 
+ 0.06*bw1careSdfMnApdex 
+ 0.25*(0.5*bw1sdpSdfSlrApdex + 0.5*bw2sdpSdfSlrApdex))
| stats sum(TimeoutScore) as TimeoutScore sum(bw1sdpSdfPccCsApdex) sum(bw1sdpSdfPccMnCsApdex)     sum(bw1sdpSdfPccPsApdex) sum(bw1sdpSdfPpsCsApdex) sum(bw2sdpSdfPpsCsApdex) sum(bw1sdpSdfPpsMnCsApdex) sum(bw2sdpSdfPpsMnCsApdex) sum(bw1sdpSdfPpsPsApdex) sum(bw2sdpSdfPpsPsApdex) sum(bw1sdpSdfPpsVisaCsApdex) sum(bw2sdpSdfPpsVisaCsApdex) sum(bw1careSdfMnApdex) sum(bw1sdpSdfSlrApdex) sum(bw2sdpSdfSlrApdex)


TimeoutScore    sum(bw1sdpSdfPccCsApdex)    sum(bw1sdpSdfPccMnCsApdex)  sum(bw1sdpSdfPccPsApdex)    sum(bw1sdpSdfPpsCsApdex)    sum(bw2sdpSdfPpsCsApdex)    sum(bw1sdpSdfPpsMnCsApdex)  sum(bw2sdpSdfPpsMnCsApdex)  sum(bw1sdpSdfPpsPsApdex)    sum(bw2sdpSdfPpsPsApdex)    sum(bw1sdpSdfPpsVisaCsApdex)    sum(bw2sdpSdfPpsVisaCsApdex)    sum(bw1careSdfMnApdex)  sum(bw1sdpSdfSlrApdex)  sum(bw2sdpSdfSlrApdex)
101 1   0.854839    0.972727    1   1   1   1   0.975410    1   1   1   0.983871    1   1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;EDIT:&lt;/STRONG&gt;&lt;BR /&gt;
Thanks to kristian.kolb suggestion, this issue was solved replacing  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval TimeoutScore=...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;by&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval TimeoutScore=exact(...)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Apr 2013 09:59:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-inconsistent-math-result/m-p/91888#M23717</guid>
      <dc:creator>splunk_zen</dc:creator>
      <dc:date>2013-04-12T09:59:33Z</dc:date>
    </item>
    <item>
      <title>Re: eval - inconsistent math result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-inconsistent-math-result/m-p/91889#M23718</link>
      <description>&lt;P&gt;Rounding errors? perhaps the &lt;CODE&gt;exact()&lt;/CODE&gt; function for &lt;CODE&gt;eval&lt;/CODE&gt; might help?&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonEvalFunctions"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonEvalFunctions&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2013 10:22:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-inconsistent-math-result/m-p/91889#M23718</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-04-12T10:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: eval - inconsistent math result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-inconsistent-math-result/m-p/91890#M23719</link>
      <description>&lt;P&gt;Dammit... Forgot that could be the culprit.&lt;BR /&gt;
If you promote the comment to an answer I will gladly accept it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2013 10:25:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-inconsistent-math-result/m-p/91890#M23719</guid>
      <dc:creator>splunk_zen</dc:creator>
      <dc:date>2013-04-12T10:25:03Z</dc:date>
    </item>
  </channel>
</rss>

