<?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: [Version 8.2.4] No longer able to use timestamps from return command in subsearch in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Version-8-2-4-No-longer-able-to-use-timestamps-from-return/m-p/582050#M202746</link>
    <description>&lt;P&gt;Hi steen,&lt;/P&gt;&lt;P&gt;I don't think that's a version problem. I made small test in 8.2.4 with this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=_internal 
    [| makeresults 
    | eval mi=strptime("2022-01-21 10:00","%Y-%m-%d %H:%M") 
    | eval latest = mi-0.001  
    | eval earliest = latest-3600 
    | return latest earliest]&lt;/LI-CODE&gt;&lt;P&gt;I can get the results from the expected hour.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Check the job inspector for clues. Look for the &lt;SPAN&gt;remoteSearch to see what Splunk is sending to the indexers.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 21 Jan 2022 16:44:03 GMT</pubDate>
    <dc:creator>diogofgm</dc:creator>
    <dc:date>2022-01-21T16:44:03Z</dc:date>
    <item>
      <title>[Version 8.2.4] No longer able to use timestamps from return command in subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Version-8-2-4-No-longer-able-to-use-timestamps-from-return/m-p/582036#M202742</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;In the past (Splunk Enterprise v 7.x.x) I used the below search to run a report every few min. There were so many results that due to limitations I had to run them 1 day spans. I needed to do this for 6 months of data so I automated the process with a repeating report...&lt;/P&gt;&lt;P&gt;I would run this search to create the first entries which is necessary of the next step&lt;/P&gt;&lt;P&gt;index="app" sourcetype="api" type=log*&lt;BR /&gt;| eval time=_time&lt;BR /&gt;| sort time desc&lt;BR /&gt;| table time type version&lt;BR /&gt;| outputlookup append=false My_file.csv&lt;/P&gt;&lt;P&gt;Then I created a report , set it to run every 1 or 2 minutes with the below search. It basically looks at the earliest date in&amp;nbsp;My_file.csv file, then adjust the earliest and latest times for the main search.&lt;/P&gt;&lt;P&gt;index="app" sourcetype="api" type=log*&lt;BR /&gt;[| inputlookup My_file.csv&lt;BR /&gt;| stats min(time) as mi&lt;BR /&gt;| eval latest=(mi-0.001)&lt;BR /&gt;| eval earliest=(latest-86400)&lt;BR /&gt;| return earliest latest]&lt;BR /&gt;| eval time=_time&lt;BR /&gt;| table time type version&lt;BR /&gt;| sort time desc&lt;BR /&gt;| outputlookup append=true My_file.csv&lt;/P&gt;&lt;P&gt;It just runs the search with the timeframe in my Splunk time picker. It doesn't seem to take the earliest and latest from my 'return' command in the subsearch.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;If I try running the subsearch only, then I do get a result...&lt;BR /&gt;| inputlookup My_file.csv&lt;BR /&gt;| stats min(time) as mi&lt;BR /&gt;| eval latest=(mi-0.001)&lt;BR /&gt;| eval earliest=(latest-86400)&lt;BR /&gt;| return earliest latest&lt;/P&gt;&lt;P&gt;Give me the below results, so I don't get why the value isn't used in the top search&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;earliest="1642374033.873" latest="1642719633.873"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It works though if I do a map, but that's not a viable solution due to the high volumes...&lt;/P&gt;&lt;P&gt;| inputlookup My_file.csv&lt;BR /&gt;| stats min(time) as mi&lt;BR /&gt;| eval latest=(mi-0.001)&lt;BR /&gt;| eval earliest=(latest-86400)&lt;BR /&gt;| table earliest latest&lt;BR /&gt;| map maxsearches=10 search="search index="app" sourcetype="api" type=log* earliest="$earliest$" latest="$latest$""&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What's frustrating is that this used to work and now I need to do the same exercise and I can't use it again.&lt;/P&gt;&lt;P&gt;Does anybody have an idea why it's not working? Have you experience similar issues?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2022 16:08:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Version-8-2-4-No-longer-able-to-use-timestamps-from-return/m-p/582036#M202742</guid>
      <dc:creator>steen</dc:creator>
      <dc:date>2022-01-21T16:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: [Version 8.2.4] No longer able to use timestamps from return command in subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Version-8-2-4-No-longer-able-to-use-timestamps-from-return/m-p/582040#M202743</link>
      <description>&lt;P&gt;Additional info:&lt;BR /&gt;If I take the values from the return command in the subsearch and replace it into a makeresults command, then it works&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;i&lt;SPAN&gt;ndex="app" sourcetype="api" type=log*&lt;/SPAN&gt; [| makeresults | eval earliest="1642304033.873" | eval latest="1642719633.873" | return earliest latest]&lt;BR /&gt;&lt;BR /&gt;I don't get why it works here but not with the inputlook up, it's pretty much the same thing. no?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2022 16:19:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Version-8-2-4-No-longer-able-to-use-timestamps-from-return/m-p/582040#M202743</guid>
      <dc:creator>steen</dc:creator>
      <dc:date>2022-01-21T16:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: [Version 8.2.4] No longer able to use timestamps from return command in subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Version-8-2-4-No-longer-able-to-use-timestamps-from-return/m-p/582050#M202746</link>
      <description>&lt;P&gt;Hi steen,&lt;/P&gt;&lt;P&gt;I don't think that's a version problem. I made small test in 8.2.4 with this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=_internal 
    [| makeresults 
    | eval mi=strptime("2022-01-21 10:00","%Y-%m-%d %H:%M") 
    | eval latest = mi-0.001  
    | eval earliest = latest-3600 
    | return latest earliest]&lt;/LI-CODE&gt;&lt;P&gt;I can get the results from the expected hour.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Check the job inspector for clues. Look for the &lt;SPAN&gt;remoteSearch to see what Splunk is sending to the indexers.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2022 16:44:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Version-8-2-4-No-longer-able-to-use-timestamps-from-return/m-p/582050#M202746</guid>
      <dc:creator>diogofgm</dc:creator>
      <dc:date>2022-01-21T16:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: [Version 8.2.4] No longer able to use timestamps from return command in subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Version-8-2-4-No-longer-able-to-use-timestamps-from-return/m-p/582052#M202747</link>
      <description>&lt;P&gt;I would edit the main post with those details instead of posting a reply&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2022 16:46:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Version-8-2-4-No-longer-able-to-use-timestamps-from-return/m-p/582052#M202747</guid>
      <dc:creator>diogofgm</dc:creator>
      <dc:date>2022-01-21T16:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: [Version 8.2.4] No longer able to use timestamps from return command in subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Version-8-2-4-No-longer-able-to-use-timestamps-from-return/m-p/582090#M202763</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/90723"&gt;@diogofgm&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I noticed you didn't use the p&lt;SPAN&gt;arentheses here:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval latest = mi-0.001  
| eval earliest = latest-3600 &lt;/LI-CODE&gt;&lt;P&gt;So I tried removing them from my search and it works!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="app" sourcetype="api" type=log*
[| inputlookup My_file.csv
| stats min(time) as mi
| eval latest=mi-0.001
| eval earliest=latest-86400
| return earliest latest]
| eval time=_time
| table time type version
| sort time desc
| outputlookup append=true My_file.csv&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't understand how the p&lt;SPAN&gt;arentheses causes it to fail. Furthermore, the return works fine with parentheses when I use it as a search on it's own (not as subsearch). And it used to work fine on our older version of Splunk.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Oh well...thanks for your input, much appreciated&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;PS:&lt;/STRONG&gt;&amp;nbsp;How do I edit my post, I looked everywhere, but don't seem to have the option.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2022 19:55:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Version-8-2-4-No-longer-able-to-use-timestamps-from-return/m-p/582090#M202763</guid>
      <dc:creator>steen</dc:creator>
      <dc:date>2022-01-21T19:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: [Version 8.2.4] No longer able to use timestamps from return command in subsearch</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Version-8-2-4-No-longer-able-to-use-timestamps-from-return/m-p/582101#M202769</link>
      <description>&lt;P&gt;Glad I pointed you in right direction.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;As for the edit, there a down arrow on the right side just above the post title where you have multiple options regarding the post and edit is just one of them.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jan 2022 00:14:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Version-8-2-4-No-longer-able-to-use-timestamps-from-return/m-p/582101#M202769</guid>
      <dc:creator>diogofgm</dc:creator>
      <dc:date>2022-01-22T00:14:14Z</dc:date>
    </item>
  </channel>
</rss>

