<?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: Possible eval min bug? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Possible-eval-min-bug/m-p/54061#M13190</link>
    <description>&lt;P&gt;Probably a bug. Try using &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval minX = min(tonumber(X1), tonumber(X2), tonumber(X3)) | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;instead.&lt;/P&gt;

&lt;P&gt;It is likely related to this: &lt;A href="http://answers.splunk.com/questions/11523/getting-maximum-value-from-a-series-of-fields-not-working" rel="nofollow"&gt;http://answers.splunk.com/questions/11523/getting-maximum-value-from-a-series-of-fields-not-working&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 05 Mar 2011 08:10:11 GMT</pubDate>
    <dc:creator>gkanapathy</dc:creator>
    <dc:date>2011-03-05T08:10:11Z</dc:date>
    <item>
      <title>Possible eval min bug?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Possible-eval-min-bug/m-p/54059#M13188</link>
      <description>&lt;P&gt;Howdy, I've got some very simple data and I'm running the following on it:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main sourcetype=something host=something-else.csv
| eval minX = min(X1, X2, X3)
| timechart span=1day min(X1) min(X2) min(X3) min(minX)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;CODE&gt;X1&lt;/CODE&gt;, &lt;CODE&gt;X2&lt;/CODE&gt;, &lt;CODE&gt;X3&lt;/CODE&gt; all range both positive &amp;amp; negative, as well as including decimals.&lt;/P&gt;

&lt;P&gt;Oddly, the above always gives the value of &lt;CODE&gt;X2&lt;/CODE&gt; for &lt;CODE&gt;minX&lt;/CODE&gt;. However, if I change it to&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main sourcetype=something host=something-else.csv
| eval minX = min(1000000, X1, X2, X3)
| timechart span=1day min(X1) min(X2) min(X3) min(minX)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;where 1000000 is some number above all the other numbers, it works as I want it to and selects the minimum value of the 3 fields.&lt;BR /&gt;
I'm not sure why adding the 4th value should change anything... any ideas?&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2011 19:10:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Possible-eval-min-bug/m-p/54059#M13188</guid>
      <dc:creator>vaijpc</dc:creator>
      <dc:date>2011-03-04T19:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: Possible eval min bug?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Possible-eval-min-bug/m-p/54060#M13189</link>
      <description>&lt;P&gt;One idea, is that in the docs it says that min(X,...)  will actually operate on strings as well as numbers.   It says specifically that strings sort higher than numbers. &lt;/P&gt;

&lt;P&gt;&lt;A href="http://www.splunk.com/base/Documentation/latest/SearchReference/CommonEvalFunctions" rel="nofollow"&gt;http://www.splunk.com/base/Documentation/latest/SearchReference/CommonEvalFunctions&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;However timechart and chart will always ignore values that are not numbers. &lt;/P&gt;

&lt;P&gt;The difference is somewhat sensible -- timechart and chart, when you're using their numeric functions, are designed to 'graph' and 'chart' things so they silently filter out occasional non-numeric outliers. eval on the other hand is a much more general tool.&lt;/P&gt;

&lt;P&gt;So one idea is to use the eval functions isnum() and tonumber() to see what you can find out anything weird about X2. &lt;/P&gt;

&lt;P&gt;see if this changes anything -- &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main sourcetype=something host=something-else.csv 
| eval x2IsNumber = if(isnum(X2),1,0) | timechart count sum(x2IsNumber) as x2numericCount
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and look for places where the second line drops below the count line.  If there are any such places you may have your culprit.&lt;/P&gt;</description>
      <pubDate>Sat, 05 Mar 2011 01:02:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Possible-eval-min-bug/m-p/54060#M13189</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2011-03-05T01:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: Possible eval min bug?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Possible-eval-min-bug/m-p/54061#M13190</link>
      <description>&lt;P&gt;Probably a bug. Try using &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval minX = min(tonumber(X1), tonumber(X2), tonumber(X3)) | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;instead.&lt;/P&gt;

&lt;P&gt;It is likely related to this: &lt;A href="http://answers.splunk.com/questions/11523/getting-maximum-value-from-a-series-of-fields-not-working" rel="nofollow"&gt;http://answers.splunk.com/questions/11523/getting-maximum-value-from-a-series-of-fields-not-working&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Mar 2011 08:10:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Possible-eval-min-bug/m-p/54061#M13190</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2011-03-05T08:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: Possible eval min bug?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Possible-eval-min-bug/m-p/54062#M13191</link>
      <description>&lt;P&gt;I'm afraid the lines were always equal.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2011 20:30:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Possible-eval-min-bug/m-p/54062#M13191</guid>
      <dc:creator>vaijpc</dc:creator>
      <dc:date>2011-03-07T20:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: Possible eval min bug?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Possible-eval-min-bug/m-p/54063#M13192</link>
      <description>&lt;P&gt;Yep this looks to have resolved the issue. Means I don't need to chose an arbitrarily large number as my first field for min() so wahey. Still, min() shouldn't treat individual parameters differently depending on the other parameters should it? I can't seem to find a bugtracker to file this on, are you able to reproduce this? How should I notify 'splunk'?&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2011 20:32:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Possible-eval-min-bug/m-p/54063#M13192</guid>
      <dc:creator>vaijpc</dc:creator>
      <dc:date>2011-03-07T20:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: Possible eval min bug?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Possible-eval-min-bug/m-p/54064#M13193</link>
      <description>&lt;P&gt;Well, it was worth a shot. &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Mar 2011 01:17:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Possible-eval-min-bug/m-p/54064#M13193</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2011-03-08T01:17:04Z</dc:date>
    </item>
    <item>
      <title>Re: Possible eval min bug?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Possible-eval-min-bug/m-p/54065#M13194</link>
      <description>&lt;P&gt;Yup, i guess isnum and eval min() just decide in different ways. Don't suppose you know where I could file a bug?&lt;/P&gt;</description>
      <pubDate>Tue, 08 Mar 2011 17:19:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Possible-eval-min-bug/m-p/54065#M13194</guid>
      <dc:creator>vaijpc</dc:creator>
      <dc:date>2011-03-08T17:19:06Z</dc:date>
    </item>
    <item>
      <title>Re: Possible eval min bug?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Possible-eval-min-bug/m-p/54066#M13195</link>
      <description>&lt;P&gt;Sure, it's easy.  Just send an email to &lt;A href="mailto:support@splunk.com"&gt;support@splunk.com&lt;/A&gt; and they'll file it for you.  splunk support is awesome. Say hi from nick. &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2011 02:53:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Possible-eval-min-bug/m-p/54066#M13195</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2011-03-09T02:53:41Z</dc:date>
    </item>
  </channel>
</rss>

