<?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: Modify subsearch time starting with timerange picker token in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Modify-subsearch-time-starting-with-timerange-picker-token/m-p/314921#M94258</link>
    <description>&lt;P&gt;For some reason I can not get this to work.  I simply want the entire dashboard to offset the latest time by 5 minutes.  If I try the suggestion above in a query window with my base search for some reason it alters the earliest time to months ago.  Not sure whats going on can't I just do this?&lt;/P&gt;

&lt;P&gt;basesearch&lt;BR /&gt;
     [| gentimes start=-1 | addinfo | eval latest=info_max_time-300 | table latest]&lt;BR /&gt;
|join.......&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 03:11:45 GMT</pubDate>
    <dc:creator>Cuyose</dc:creator>
    <dc:date>2020-09-30T03:11:45Z</dc:date>
    <item>
      <title>Modify subsearch time starting with timerange picker token</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Modify-subsearch-time-starting-with-timerange-picker-token/m-p/314916#M94253</link>
      <description>&lt;P&gt;I have a situation where I want to run a main search of one index over a time period driven by the time picker on a dashboard, but annotate the results with information from a second search. The subsearch doing the annotation needs to run over a time period that searches a week earlier than the main search.&lt;/P&gt;

&lt;P&gt;My subsearch:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| join foo type=outer [search earliest=$field1.earliest$-604800 index="someindex" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This works fine as long as the format of the time coming from the token is relative (@w, -d@d, etc.). If that token value is epoch time format (using date or date/time on the picker), the subsearch doesn’t run.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;earliest=1511969191-608400&lt;/CODE&gt; will not evaluate. &lt;CODE&gt;earliest=@w-604800&lt;/CODE&gt; will evaluate.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2017 15:33:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Modify-subsearch-time-starting-with-timerange-picker-token/m-p/314916#M94253</guid>
      <dc:creator>mstark31</dc:creator>
      <dc:date>2017-11-29T15:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: Modify subsearch time starting with timerange picker token</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Modify-subsearch-time-starting-with-timerange-picker-token/m-p/314917#M94254</link>
      <description>&lt;P&gt;Try like this (adding another subsearch within join subsearch which returns manipulated earliest)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...base search
| join foo type=outer [search index="someindex" [| gentimes start=-1 | addinfo | eval earliest=info_min_time-604800 | table earliest] ..rest of join subsearch...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 Nov 2017 15:41:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Modify-subsearch-time-starting-with-timerange-picker-token/m-p/314917#M94254</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-11-29T15:41:16Z</dc:date>
    </item>
    <item>
      <title>Re: Modify subsearch time starting with timerange picker token</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Modify-subsearch-time-starting-with-timerange-picker-token/m-p/314918#M94255</link>
      <description>&lt;P&gt;Thank you! This appears to be working.&lt;BR /&gt;
If I wanted to alter the latest time to be based on an offset from the earliest time, would this work? Examples is to make lastest time 5min after earliest time.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[| gentimes start=-1 | addinfo | eval latest=info_min_time+300 | table latest]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also, why do you use table vs. return in the last pipe of the gentimes subsearch?&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2017 20:51:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Modify-subsearch-time-starting-with-timerange-picker-token/m-p/314918#M94255</guid>
      <dc:creator>mstark31</dc:creator>
      <dc:date>2017-11-29T20:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: Modify subsearch time starting with timerange picker token</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Modify-subsearch-time-starting-with-timerange-picker-token/m-p/314919#M94256</link>
      <description>&lt;P&gt;For your latest time override,I would update the latest as well as earliest in subsearch else, earliest would be default to 0 (all times). &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[| gentimes start=-1 | addinfo | eval latest=info_min_time+300 | eval earliest=info_min_time | table earliest latest]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you want to return single field (like in first case), you can use either of &lt;CODE&gt;table&lt;/CODE&gt; or &lt;CODE&gt;return&lt;/CODE&gt;. Table command is useful when returning multiple fields (like in above case)&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2017 21:00:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Modify-subsearch-time-starting-with-timerange-picker-token/m-p/314919#M94256</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-11-29T21:00:15Z</dc:date>
    </item>
    <item>
      <title>Re: Modify subsearch time starting with timerange picker token</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Modify-subsearch-time-starting-with-timerange-picker-token/m-p/314920#M94257</link>
      <description>&lt;P&gt;Thank you! I inadvertently discovered the need to specify an earliest time with the latest time in another search yesterday, so good reminder.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2017 21:15:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Modify-subsearch-time-starting-with-timerange-picker-token/m-p/314920#M94257</guid>
      <dc:creator>mstark31</dc:creator>
      <dc:date>2017-11-29T21:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: Modify subsearch time starting with timerange picker token</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Modify-subsearch-time-starting-with-timerange-picker-token/m-p/314921#M94258</link>
      <description>&lt;P&gt;For some reason I can not get this to work.  I simply want the entire dashboard to offset the latest time by 5 minutes.  If I try the suggestion above in a query window with my base search for some reason it alters the earliest time to months ago.  Not sure whats going on can't I just do this?&lt;/P&gt;

&lt;P&gt;basesearch&lt;BR /&gt;
     [| gentimes start=-1 | addinfo | eval latest=info_max_time-300 | table latest]&lt;BR /&gt;
|join.......&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:11:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Modify-subsearch-time-starting-with-timerange-picker-token/m-p/314921#M94258</guid>
      <dc:creator>Cuyose</dc:creator>
      <dc:date>2020-09-30T03:11:45Z</dc:date>
    </item>
    <item>
      <title>Re: Modify subsearch time starting with timerange picker token</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Modify-subsearch-time-starting-with-timerange-picker-token/m-p/314922#M94259</link>
      <description>&lt;P&gt;I figured this out, added the earliest variable and used return at the beginning of the base search.&lt;/P&gt;

&lt;P&gt;[| gentimes start=-1 &lt;BR /&gt;
    | addinfo &lt;BR /&gt;
    | eval earliest=info_min_time&lt;BR /&gt;
    | eval latest=info_max_time-300 &lt;BR /&gt;
    | return earliest latest] &lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:11:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Modify-subsearch-time-starting-with-timerange-picker-token/m-p/314922#M94259</guid>
      <dc:creator>Cuyose</dc:creator>
      <dc:date>2020-09-30T03:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: Modify subsearch time starting with timerange picker token</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Modify-subsearch-time-starting-with-timerange-picker-token/m-p/314923#M94260</link>
      <description>&lt;P&gt;I think I was having issues with the suggestion here as well, but I ended up going another route for my original problem. Thank you for coming up with a better solution!&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2019 17:50:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Modify-subsearch-time-starting-with-timerange-picker-token/m-p/314923#M94260</guid>
      <dc:creator>mstark31</dc:creator>
      <dc:date>2019-12-05T17:50:36Z</dc:date>
    </item>
  </channel>
</rss>

