<?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: Where and eval weirdness? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Where-and-eval-weirdness/m-p/47553#M11348</link>
    <description>&lt;P&gt;Hey @Lowell can you select your answer? &lt;/P&gt;</description>
    <pubDate>Fri, 01 Mar 2019 21:58:37 GMT</pubDate>
    <dc:creator>ryhluc01</dc:creator>
    <dc:date>2019-03-01T21:58:37Z</dc:date>
    <item>
      <title>Where and eval weirdness?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Where-and-eval-weirdness/m-p/47551#M11346</link>
      <description>&lt;P&gt;I have a multi-value field called &lt;CODE&gt;TotalRows&lt;/CODE&gt; (which is in contains a list of values in time order) and I'm trying to determine when the last value is less than the first value as a simple means to detect decreasing trend in the field....&lt;/P&gt;

&lt;P&gt;This approach works:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval first_rows=mvindex(TotalRows,0) 
    | eval last_rows=mvindex(TotalRows,-1)
    | where first_rows&amp;gt;last_rows
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But when I simply this expression and remove the extra (unwanted) fields, it doesn't work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | where mvindex(TotalRows,0) &amp;gt; mvindex(TotalRows,-1) 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any ideas?&lt;/P&gt;</description>
      <pubDate>Sat, 19 Feb 2011 08:16:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Where-and-eval-weirdness/m-p/47551#M11346</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2011-02-19T08:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: Where and eval weirdness?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Where-and-eval-weirdness/m-p/47552#M11347</link>
      <description>&lt;P&gt;Hmm, think I figured it out.&lt;/P&gt;

&lt;P&gt;It looks like &lt;CODE&gt;mvindex&lt;/CODE&gt; must always consider it's return value to be a string.  Therefore, forcing it to a number allows the single expression to work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | where tonumber(mvindex(TotalRows,0)) &amp;gt; tonumber(mvindex(TotalRows,-1)) 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 19 Feb 2011 08:20:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Where-and-eval-weirdness/m-p/47552#M11347</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2011-02-19T08:20:37Z</dc:date>
    </item>
    <item>
      <title>Re: Where and eval weirdness?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Where-and-eval-weirdness/m-p/47553#M11348</link>
      <description>&lt;P&gt;Hey @Lowell can you select your answer? &lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 21:58:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Where-and-eval-weirdness/m-p/47553#M11348</guid>
      <dc:creator>ryhluc01</dc:creator>
      <dc:date>2019-03-01T21:58:37Z</dc:date>
    </item>
  </channel>
</rss>

