<?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: Invalid value &amp;quot;$earliest$&amp;quot; for time term 'earliest' in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Invalid-value-quot-earliest-quot-for-time-term-earliest/m-p/694829#M236308</link>
    <description>&lt;P&gt;Hmm, the documentation says map can use a subsearch&lt;/P&gt;&lt;BLOCKQUOTE&gt;3. Use the map command with a subsearch&lt;BR /&gt;For complex ad hoc searches, use a subsearch for your map search&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Map#Basic_examples" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Map#Basic_examples&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 31 Jul 2024 14:15:33 GMT</pubDate>
    <dc:creator>dataisbeautiful</dc:creator>
    <dc:date>2024-07-31T14:15:33Z</dc:date>
    <item>
      <title>Invalid value "$earliest$" for time term 'earliest'</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Invalid-value-quot-earliest-quot-for-time-term-earliest/m-p/694815#M236301</link>
      <description>&lt;P&gt;Hi Splukers&lt;/P&gt;&lt;P&gt;I'm looking for cross compare some events with other system data, using an initial search for the event and then using map to load data from another index&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=event sourcetype=eventdat
| where like(details,"...")) 
| eval earliest=floor(_time), latest=ceil(_time+2)
| table _time details earliest latest
| map 
    [ search index=sys_stats sourcetype=statdat device="..." earliest=$earliest$ latest=$latest$
    | stats count as counter
    | eval details=$details$, earliest=$earliest$, latest=$latest$ 
    | table _time details counter earliest latest] maxsearches=10&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When running I get the error:&lt;BR /&gt;&lt;EM&gt;Invalid value "$earliest$" for time term 'earliest'&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I've tried $$ and "$...$" with no luck. I can't figure out why $earliest$ isn't being passed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated (:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Notes: I've reviewed these posts but they don't seem relevant&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.splunk.com/t5/Splunk-Search/Invalid-value-X-for-time-term-earliest-but-only-for-specific/m-p/624962#M217251" target="_blank" rel="noopener"&gt;https://community.splunk.com/t5/Splunk-Search/Invalid-value-X-for-time-term-earliest-but-only-for-specific/m-p/624962#M217251&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.splunk.com/t5/Splunk-Search/Invalid-value-quot-week-quot-for-time-term-earliest/m-p/469491#M132104" target="_blank" rel="noopener"&gt;https://community.splunk.com/t5/Splunk-Search/Invalid-value-quot-week-quot-for-time-term-earliest/m-p/469491#M132104&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2024 10:41:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Invalid-value-quot-earliest-quot-for-time-term-earliest/m-p/694815#M236301</guid>
      <dc:creator>dataisbeautiful</dc:creator>
      <dc:date>2024-07-31T10:41:22Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid value "$earliest$" for time term 'earliest'</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Invalid-value-quot-earliest-quot-for-time-term-earliest/m-p/694818#M236302</link>
      <description>&lt;P&gt;It's not that $earliest$ is not being passed, it's that the value being passed is invalid.&amp;nbsp; The value for the earliest option must be a time modifier ("-1d", for example) or a timestamp in the format &lt;FONT face="courier new,courier"&gt;%m/%d/%Y:%H:%M:%S&lt;/FONT&gt;.&amp;nbsp; It cannot be an epoch timestamp, but you can use &lt;FONT face="courier new,courier"&gt;strftime&lt;/FONT&gt; to convert an epoch into the expected format.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval earliest = strftime(earliest, "%m/%d/%Y:%H:%M:%S")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2024 12:25:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Invalid-value-quot-earliest-quot-for-time-term-earliest/m-p/694818#M236302</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2024-07-31T12:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid value "$earliest$" for time term 'earliest'</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Invalid-value-quot-earliest-quot-for-time-term-earliest/m-p/694824#M236306</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the tip, I've updated my query&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=event sourcetype=eventdat
| where like(details,"...")) 
| eval earliest=strftime(floor(_time), "%m/%d/%Y:%H:%M:%S"), latest=strftime(ceil(_time+2), "%m/%d/%Y:%H:%M:%S")
| table _time details earliest latest
| map 
    [ search index=sys_stats sourcetype=statdat device="..." earliest=$earliest$ latest=$latest$
    | stats count as counter
    | eval details=$details$, earliest="$earliest$", latest="$latest$" 
    | table _time details counter earliest latest] maxsearches=10&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's still throwing the error&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Invalid value "$earliest$" for time term 'earliest'&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2024 13:45:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Invalid-value-quot-earliest-quot-for-time-term-earliest/m-p/694824#M236306</guid>
      <dc:creator>dataisbeautiful</dc:creator>
      <dc:date>2024-07-31T13:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid value "$earliest$" for time term 'earliest'</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Invalid-value-quot-earliest-quot-for-time-term-earliest/m-p/694827#M236307</link>
      <description>&lt;P&gt;I see another syntax error.&amp;nbsp; The &lt;FONT face="courier new,courier"&gt;map&lt;/FONT&gt; command expects its search string to be in quotation marks rather than as a subsearch.&amp;nbsp; The $earliest$ form doesn't work in subsearches (except in a dashboard).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=event sourcetype=eventdat
| where like(details,"...")) 
| eval earliest=strftime(floor(_time), "%m/%d/%Y:%H:%M:%S"), latest=strftime(ceil(_time+2), "%m/%d/%Y:%H:%M:%S")
| table _time details earliest latest
| map maxsearches=10
    search = "index=sys_stats sourcetype=statdat device="..." earliest=$earliest$ latest=$latest$
    | stats count as counter
    | eval details=$details$, earliest=\"$earliest$\", latest=\"$latest$\" 
    | table _time details counter earliest latest"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2024 14:38:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Invalid-value-quot-earliest-quot-for-time-term-earliest/m-p/694827#M236307</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2024-07-31T14:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid value "$earliest$" for time term 'earliest'</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Invalid-value-quot-earliest-quot-for-time-term-earliest/m-p/694829#M236308</link>
      <description>&lt;P&gt;Hmm, the documentation says map can use a subsearch&lt;/P&gt;&lt;BLOCKQUOTE&gt;3. Use the map command with a subsearch&lt;BR /&gt;For complex ad hoc searches, use a subsearch for your map search&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Map#Basic_examples" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Map#Basic_examples&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2024 14:15:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Invalid-value-quot-earliest-quot-for-time-term-earliest/m-p/694829#M236308</guid>
      <dc:creator>dataisbeautiful</dc:creator>
      <dc:date>2024-07-31T14:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid value "$earliest$" for time term 'earliest'</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Invalid-value-quot-earliest-quot-for-time-term-earliest/m-p/694833#M236309</link>
      <description>&lt;P&gt;I can't say I've seen that form used in the wild.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2024 14:38:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Invalid-value-quot-earliest-quot-for-time-term-earliest/m-p/694833#M236309</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2024-07-31T14:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid value "$earliest$" for time term 'earliest'</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Invalid-value-quot-earliest-quot-for-time-term-earliest/m-p/694840#M236310</link>
      <description>&lt;P&gt;I beg to differ.&lt;/P&gt;&lt;P&gt;I've used earliest/latest with epoch timestamps many times.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2024 14:55:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Invalid-value-quot-earliest-quot-for-time-term-earliest/m-p/694840#M236310</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-07-31T14:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid value "$earliest$" for time term 'earliest'</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Invalid-value-quot-earliest-quot-for-time-term-earliest/m-p/694841#M236311</link>
      <description>&lt;P&gt;Agreed &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've just done a test and epoch times work just fine with earliest and latest in a search. The formatting seems to be a red herring here.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2024 14:58:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Invalid-value-quot-earliest-quot-for-time-term-earliest/m-p/694841#M236311</guid>
      <dc:creator>dataisbeautiful</dc:creator>
      <dc:date>2024-07-31T14:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid value "$earliest$" for time term 'earliest'</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Invalid-value-quot-earliest-quot-for-time-term-earliest/m-p/694854#M236314</link>
      <description>&lt;P&gt;It's not very common but it lets you avoid escaping yourself to death &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2024 16:52:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Invalid-value-quot-earliest-quot-for-time-term-earliest/m-p/694854#M236314</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-07-31T16:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid value "$earliest$" for time term 'earliest'</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Invalid-value-quot-earliest-quot-for-time-term-earliest/m-p/694995#M236355</link>
      <description>&lt;P&gt;Some more digging, this seems to be the same issue:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.splunk.com/t5/Splunk-Search/Having-a-problem-substituting-value-for-earliest-in-a-map/m-p/33122" target="_blank"&gt;https://community.splunk.com/t5/Splunk-Search/Having-a-problem-substituting-value-for-earliest-in-a-map/m-p/33122&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2024 15:03:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Invalid-value-quot-earliest-quot-for-time-term-earliest/m-p/694995#M236355</guid>
      <dc:creator>dataisbeautiful</dc:creator>
      <dc:date>2024-08-01T15:03:36Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid value "$earliest$" for time term 'earliest'</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Invalid-value-quot-earliest-quot-for-time-term-earliest/m-p/702358#M238166</link>
      <description>&lt;P&gt;I've been in touch with support, this is a known &lt;EM&gt;issue&lt;/EM&gt; and there's no plan to fix.&lt;/P&gt;&lt;P&gt;There is a workaround that can be used:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| map [search index=_internal [| makeresults | eval earliest=$earliest$, latest=$latest$ | return earliest, latest]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's a bit longer and needs another subsearch, but can be easier than escaping everything.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks everyone for their input &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/231884"&gt;@PickleRick&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2024 08:19:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Invalid-value-quot-earliest-quot-for-time-term-earliest/m-p/702358#M238166</guid>
      <dc:creator>dataisbeautiful</dc:creator>
      <dc:date>2024-10-21T08:19:02Z</dc:date>
    </item>
  </channel>
</rss>

