<?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: Overwite earliest/latest time during search for saved search in Other Usage</title>
    <link>https://community.splunk.com/t5/Other-Usage/How-to-overwrite-earliest-latest-time-during-search-for-saved/m-p/495084#M1583</link>
    <description>&lt;P&gt;A saved search has a defined time window which is configured when you build the original search, this timeframe is used when the search is executed.&lt;/P&gt;

&lt;P&gt;You cant pass earliest/latest to the savedsearch command because you are recalling events with a predeterimined window.&lt;BR /&gt;
Notice that that parameters have not formatted as green when passed to the saved search, but they do for the normal search.&lt;/P&gt;

&lt;P&gt;If you are using the saved search to recall a complex search query, consider using a macro instead.&lt;/P&gt;</description>
    <pubDate>Thu, 23 Jan 2020 13:15:23 GMT</pubDate>
    <dc:creator>nickhills</dc:creator>
    <dc:date>2020-01-23T13:15:23Z</dc:date>
    <item>
      <title>How to overwrite earliest/latest time during search for saved search?</title>
      <link>https://community.splunk.com/t5/Other-Usage/How-to-overwrite-earliest-latest-time-during-search-for-saved/m-p/495083#M1582</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am looking for changing earliest/latest time during search for saved searches. It's working for normal search query but not for savedsearch. Is this expected ?&lt;/P&gt;
&lt;P&gt;Is there a way to override time for savedsearch ? For my searchquery I am getting earliest/latest time from another file generated dynamically. so can't use timepicker.&lt;/P&gt;
&lt;P&gt;Case 1: Override of earliest/latest time doen't work for saved search.&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/8283i32B7130F3F6C98EA/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Case 2 : Override of earliest/latest time works for normal search query.&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/8284iF2D27D41E871C72E/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 15:07:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/How-to-overwrite-earliest-latest-time-during-search-for-saved/m-p/495083#M1582</guid>
      <dc:creator>AKG1_old1</dc:creator>
      <dc:date>2022-03-11T15:07:18Z</dc:date>
    </item>
    <item>
      <title>Re: Overwite earliest/latest time during search for saved search</title>
      <link>https://community.splunk.com/t5/Other-Usage/How-to-overwrite-earliest-latest-time-during-search-for-saved/m-p/495084#M1583</link>
      <description>&lt;P&gt;A saved search has a defined time window which is configured when you build the original search, this timeframe is used when the search is executed.&lt;/P&gt;

&lt;P&gt;You cant pass earliest/latest to the savedsearch command because you are recalling events with a predeterimined window.&lt;BR /&gt;
Notice that that parameters have not formatted as green when passed to the saved search, but they do for the normal search.&lt;/P&gt;

&lt;P&gt;If you are using the saved search to recall a complex search query, consider using a macro instead.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 13:15:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/How-to-overwrite-earliest-latest-time-during-search-for-saved/m-p/495084#M1583</guid>
      <dc:creator>nickhills</dc:creator>
      <dc:date>2020-01-23T13:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: Overwite earliest/latest time during search for saved search</title>
      <link>https://community.splunk.com/t5/Other-Usage/How-to-overwrite-earliest-latest-time-during-search-for-saved/m-p/588611#M1584</link>
      <description>&lt;P&gt;There is a way to achieve this, but your savedsearch has to cater for it. You can't amend the savedsearch timespan by just putting earliest= latest= in the command properties -- that doesn't work. You have to provide the data as variables to the savedsearch.&lt;/P&gt;&lt;P&gt;Here is a savedsearch I have created called "&lt;SPAN class=""&gt;Makeresults Show Times&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;index=_internal earliest=$etime$ latest=$ltime$
| head 1
| addinfo
| convert ctime(info_min_time) as earliest_time ctime(info_max_time) as latest_time timeformat="%d/%m/%Y %H:%M:%S"
| table earliest_time latest_time&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can then pass the variables etime and ltime to the search to override the time selection, such as:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;| savedsearch "Makeresults Show Times" etime=-15m ltime=now&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This will then produce the correct data that you are looking for&lt;/P&gt;&lt;P&gt;That said, it will also break the report when it is referenced not using the etime and ltime variables -- so you would have to make a report that would only cater for this singular use case and for no others, which seems like it would introduce duplication of effort.&lt;/P&gt;&lt;P&gt;So it is possible, just not very practical.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 09:46:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/How-to-overwrite-earliest-latest-time-during-search-for-saved/m-p/588611#M1584</guid>
      <dc:creator>althomas</dc:creator>
      <dc:date>2022-03-11T09:46:27Z</dc:date>
    </item>
  </channel>
</rss>

