<?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 Changing the now() reference point before running a saved search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Changing-the-now-reference-point-before-running-a-saved-search/m-p/212099#M62058</link>
    <description>&lt;P&gt;Is it possible to change the value of &lt;CODE&gt;now&lt;/CODE&gt; (or the reference point it uses) so that I can back-date and run a saved search that uses a relative time window? As an example, say there is a saved search that contains:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;earliest=-1h latest=now | stats count by host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In this case I can't change the saved search, but I'd like to run that saved search for say &lt;CODE&gt;2016-01-01 01:00&lt;/CODE&gt;.  Can I tell the saved search to use that specific time as the reference point of &lt;CODE&gt;now&lt;/CODE&gt;?  &lt;/P&gt;

&lt;P&gt;I'm running the search via web export ( &lt;CODE&gt;/servicesNS/&amp;lt;name&amp;gt;/&amp;lt;app&amp;gt;/search/jobs/export&lt;/CODE&gt;), so curious if there could be a request parameter I could set or something?&lt;/P&gt;</description>
    <pubDate>Tue, 03 Jan 2017 07:09:56 GMT</pubDate>
    <dc:creator>Kindred</dc:creator>
    <dc:date>2017-01-03T07:09:56Z</dc:date>
    <item>
      <title>Changing the now() reference point before running a saved search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Changing-the-now-reference-point-before-running-a-saved-search/m-p/212099#M62058</link>
      <description>&lt;P&gt;Is it possible to change the value of &lt;CODE&gt;now&lt;/CODE&gt; (or the reference point it uses) so that I can back-date and run a saved search that uses a relative time window? As an example, say there is a saved search that contains:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;earliest=-1h latest=now | stats count by host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In this case I can't change the saved search, but I'd like to run that saved search for say &lt;CODE&gt;2016-01-01 01:00&lt;/CODE&gt;.  Can I tell the saved search to use that specific time as the reference point of &lt;CODE&gt;now&lt;/CODE&gt;?  &lt;/P&gt;

&lt;P&gt;I'm running the search via web export ( &lt;CODE&gt;/servicesNS/&amp;lt;name&amp;gt;/&amp;lt;app&amp;gt;/search/jobs/export&lt;/CODE&gt;), so curious if there could be a request parameter I could set or something?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2017 07:09:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Changing-the-now-reference-point-before-running-a-saved-search/m-p/212099#M62058</guid>
      <dc:creator>Kindred</dc:creator>
      <dc:date>2017-01-03T07:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the now() reference point before running a saved search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Changing-the-now-reference-point-before-running-a-saved-search/m-p/212100#M62059</link>
      <description>&lt;P&gt;You can't change the value of "now" - it is actually &lt;EM&gt;not&lt;/EM&gt; the current time, but the time when the search started running.&lt;/P&gt;

&lt;P&gt;But you can use an absolute time instead of a relative time for earliest and latest. Take a look at the topic &lt;A href="https://docs.splunk.com/Documentation/Splunk/6.5.1/Search/Specifytimemodifiersinyoursearch"&gt;Specify time modifiers in your search&lt;/A&gt; in the documentation. For example, you could do this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;earliest=1/1/2016:0:0:0 latest=1/1/2016:23:59:59
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Since you are writing code, you could just do the appropriate time math in your code...&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2017 07:55:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Changing-the-now-reference-point-before-running-a-saved-search/m-p/212100#M62059</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2017-01-03T07:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the now() reference point before running a saved search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Changing-the-now-reference-point-before-running-a-saved-search/m-p/212101#M62060</link>
      <description>&lt;P&gt;As I mentioned I can't change the saved search, and it was only an example to make the point.  There's actually hundreds of saved searches that use relative time periods and various calculations using &lt;CODE&gt;now()&lt;/CODE&gt;, many of them using summary indexes, which is why I was directly asking about the reference point used by &lt;CODE&gt;now&lt;/CODE&gt; so that I wouldn't be modifying the searches.&lt;/P&gt;

&lt;P&gt;If there was a way to change where &lt;CODE&gt;now&lt;/CODE&gt; started from, all these reports could be very easily backfilled.&lt;/P&gt;

&lt;P&gt;I may be going off on a tangent anyway, is it even possible to run a scheduled search remotely that is set to summary index?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2017 22:46:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Changing-the-now-reference-point-before-running-a-saved-search/m-p/212101#M62060</guid>
      <dc:creator>Kindred</dc:creator>
      <dc:date>2017-01-03T22:46:30Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the now() reference point before running a saved search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Changing-the-now-reference-point-before-running-a-saved-search/m-p/212102#M62061</link>
      <description>&lt;P&gt;For the backfill case you can just use fill_summary_index.py and tell it over which timerange it should run the searches. See&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/7.1.3/Knowledge/Managesummaryindexgapsandoverlaps#Use_the_backfill_script_to_add_other_data_or_fill_summary_index_gaps" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/7.1.3/Knowledge/Managesummaryindexgapsandoverlaps#Use_the_backfill_script_to_add_other_data_or_fill_summary_index_gaps&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:19:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Changing-the-now-reference-point-before-running-a-saved-search/m-p/212102#M62061</guid>
      <dc:creator>dvb</dc:creator>
      <dc:date>2020-09-29T21:19:38Z</dc:date>
    </item>
  </channel>
</rss>

