<?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: assign value to earliest in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/assign-value-to-earliest/m-p/660038#M227854</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/241831"&gt;@eranhauser&lt;/a&gt;&amp;nbsp;...&lt;/P&gt;&lt;P&gt;Please check this and update us:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|makeresults | eval timeTest=strftime((floor(now()/600))*600,"%Y-%m-%d %H:%M:%S") 
| search index=test earliest=timeTest&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 06 Oct 2023 20:11:30 GMT</pubDate>
    <dc:creator>inventsekar</dc:creator>
    <dc:date>2023-10-06T20:11:30Z</dc:date>
    <item>
      <title>assign value to earliest</title>
      <link>https://community.splunk.com/t5/Splunk-Search/assign-value-to-earliest/m-p/660031#M227850</link>
      <description>&lt;P&gt;How I can assign a value to the earliest argument in my query which is the rounded to the last 10 minutes?&lt;BR /&gt;when I try index=aaa earliest=((floor(now()/600))*600&amp;nbsp; &amp;nbsp; &amp;nbsp; I get an error that&amp;nbsp;((floor(now()/600))*600 is an invalid term&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2023 19:12:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/assign-value-to-earliest/m-p/660031#M227850</guid>
      <dc:creator>eranhauser</dc:creator>
      <dc:date>2023-10-06T19:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: assign value to earliest</title>
      <link>https://community.splunk.com/t5/Splunk-Search/assign-value-to-earliest/m-p/660038#M227854</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/241831"&gt;@eranhauser&lt;/a&gt;&amp;nbsp;...&lt;/P&gt;&lt;P&gt;Please check this and update us:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|makeresults | eval timeTest=strftime((floor(now()/600))*600,"%Y-%m-%d %H:%M:%S") 
| search index=test earliest=timeTest&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2023 20:11:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/assign-value-to-earliest/m-p/660038#M227854</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2023-10-06T20:11:30Z</dc:date>
    </item>
    <item>
      <title>Re: assign value to earliest</title>
      <link>https://community.splunk.com/t5/Splunk-Search/assign-value-to-earliest/m-p/660039#M227855</link>
      <description>&lt;P&gt;We think alike.&amp;nbsp; I tried that before and although I got no error I also got no result&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2023 20:38:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/assign-value-to-earliest/m-p/660039#M227855</guid>
      <dc:creator>eranhauser</dc:creator>
      <dc:date>2023-10-06T20:38:39Z</dc:date>
    </item>
    <item>
      <title>Re: assign value to earliest</title>
      <link>https://community.splunk.com/t5/Splunk-Search/assign-value-to-earliest/m-p/660040#M227856</link>
      <description>&lt;P&gt;You can't do it like that. It's not an eval so the expression will be treated literally.&lt;/P&gt;&lt;P&gt;You'd have to use subsearch to create that value dynamically.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2023 20:48:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/assign-value-to-earliest/m-p/660040#M227856</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2023-10-06T20:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: assign value to earliest</title>
      <link>https://community.splunk.com/t5/Splunk-Search/assign-value-to-earliest/m-p/660044#M227858</link>
      <description>&lt;P&gt;Thank you. Putting the earliest and latest in the subserch worked&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2023 21:21:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/assign-value-to-earliest/m-p/660044#M227858</guid>
      <dc:creator>eranhauser</dc:creator>
      <dc:date>2023-10-06T21:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: assign value to earliest</title>
      <link>https://community.splunk.com/t5/Splunk-Search/assign-value-to-earliest/m-p/660046#M227859</link>
      <description>&lt;P&gt;Good, that you solved the issue..&amp;nbsp;&lt;/P&gt;&lt;P&gt;its an interesting issue.. the floor command "was" working fine some years ago and now it seems something wrong.. i tried using eval and floor.. it gives a complaint that right side floor output can not be assigned to left side variable.. use bool command inside the if loop along with floor command. i tried but no luck.&amp;nbsp;&lt;/P&gt;&lt;P&gt;i checked the eval's man page... but no luck. something wrong with eval command.&amp;nbsp;&lt;BR /&gt;i tried the subsearch and return logic as well.. but no luck.&amp;nbsp;&lt;/P&gt;&lt;P&gt;ok, its good that u r able to solve this issue now..&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;also please post your final SPL query also.. for everyone's learning. thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2023 21:27:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/assign-value-to-earliest/m-p/660046#M227859</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2023-10-06T21:27:38Z</dc:date>
    </item>
    <item>
      <title>Re: assign value to earliest</title>
      <link>https://community.splunk.com/t5/Splunk-Search/assign-value-to-earliest/m-p/660055#M227861</link>
      <description>&lt;LI-CODE lang="markup"&gt;Below is the query one should use:

[| makeresults 
| eval earliest=(floor(now()/600))*600-600,
 latest=(floor(now()/600))*600
]
| search index=test ....

because the sub search is being executed first the query becomes:
earliest=1234 latest=5678 index=test ...

if one tries to rename earliest or latest with a different names (like my_early_time, my_latest_time) there will be no result as the query will be:
my_early_time=1234 my_latest_time=5678 index=test ...
&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 07 Oct 2023 01:27:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/assign-value-to-earliest/m-p/660055#M227861</guid>
      <dc:creator>eranhauser</dc:creator>
      <dc:date>2023-10-07T01:27:30Z</dc:date>
    </item>
  </channel>
</rss>

