<?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 Why is my search returning error? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-search-returning-error/m-p/591972#M206060</link>
    <description>&lt;P&gt;I'm trying to run the following commands on an index:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| eval elast=strptime(lastSeen,"%Y-%m-%d %H:%M:%S")
| eval daysSinceLastSeen = round((now() - elast)/86400, 1) ```Calculate days elapsed since lastSeen```
| eval active_status = if ((latest (daysSinceLastSeen) &amp;lt;= 28), "active", "inactive")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is an error that keeps popping up stating 'latest' function is unsupported or undefined.&lt;/P&gt;
&lt;P&gt;How do I correct that?&lt;/P&gt;</description>
    <pubDate>Fri, 01 Apr 2022 16:33:27 GMT</pubDate>
    <dc:creator>parkz</dc:creator>
    <dc:date>2022-04-01T16:33:27Z</dc:date>
    <item>
      <title>Why is my search returning error?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-search-returning-error/m-p/591972#M206060</link>
      <description>&lt;P&gt;I'm trying to run the following commands on an index:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| eval elast=strptime(lastSeen,"%Y-%m-%d %H:%M:%S")
| eval daysSinceLastSeen = round((now() - elast)/86400, 1) ```Calculate days elapsed since lastSeen```
| eval active_status = if ((latest (daysSinceLastSeen) &amp;lt;= 28), "active", "inactive")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is an error that keeps popping up stating 'latest' function is unsupported or undefined.&lt;/P&gt;
&lt;P&gt;How do I correct that?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Apr 2022 16:33:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-search-returning-error/m-p/591972#M206060</guid>
      <dc:creator>parkz</dc:creator>
      <dc:date>2022-04-01T16:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my search returning error?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-search-returning-error/m-p/591980#M206064</link>
      <description>&lt;P&gt;The latest function can be used&amp;nbsp;with the &lt;FONT face="courier new,courier"&gt;chart, mstats, stats, timechart&lt;/FONT&gt;, and &lt;FONT face="courier new,courier"&gt;tstats&lt;/FONT&gt; commands, but not with &lt;FONT face="courier new,courier"&gt;eval&lt;/FONT&gt;.&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;latest&lt;/FONT&gt; doesn't make sense in this context since any given event will have a single daysSinceLastSeen field so it must be the latest one.&amp;nbsp; Finding the latest value of a field across all events requires an aggregating command like &lt;FONT face="courier new,courier"&gt;stats&lt;/FONT&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Apr 2022 16:49:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-search-returning-error/m-p/591980#M206064</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-04-01T16:49:03Z</dc:date>
    </item>
  </channel>
</rss>

