<?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: Setting earliest and latest. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Setting-earliest-and-latest/m-p/489714#M136775</link>
    <description>&lt;P&gt;Thank you,&lt;/P&gt;

&lt;P&gt;I think earliest and latest are set correctly, but no data was retrieved.&lt;BR /&gt;
( Data in the time range exist definitely. )&lt;/P&gt;

&lt;P&gt;Do u have any idea ?&lt;/P&gt;</description>
    <pubDate>Fri, 24 Jan 2020 03:09:51 GMT</pubDate>
    <dc:creator>shikata74</dc:creator>
    <dc:date>2020-01-24T03:09:51Z</dc:date>
    <item>
      <title>Setting earliest and latest.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Setting-earliest-and-latest/m-p/489703#M136764</link>
      <description>&lt;P&gt;I want to search data from "earliest" to "earliest" +  5 minutes later.&lt;/P&gt;

&lt;P&gt;How should I implement it ?&lt;/P&gt;

&lt;P&gt;I tried the following, but failed.&lt;BR /&gt;
index=xxxx earliest="yyyy/mm/dd hh:mm:ss" latest=earliest+5m&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2020 16:06:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Setting-earliest-and-latest/m-p/489703#M136764</guid>
      <dc:creator>shikata74</dc:creator>
      <dc:date>2020-01-21T16:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: Setting earliest and latest.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Setting-earliest-and-latest/m-p/489704#M136765</link>
      <description>&lt;P&gt;I'm interested in this as well. Here is a way to do it using a couple steps, not sure it will work in your case.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=xxxx sourcetype=yyyy earliest="1/21/2020:11:40:00"
| addinfo
| eval latest=info_min_time+300
| where _time&amp;lt;=latest
| (the rest of your search)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The &lt;CODE&gt;addinfo&lt;/CODE&gt; command is used here to expose internal fields. You can see many of these in the Job Inspector.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2020 16:57:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Setting-earliest-and-latest/m-p/489704#M136765</guid>
      <dc:creator>jpolvino</dc:creator>
      <dc:date>2020-01-21T16:57:11Z</dc:date>
    </item>
    <item>
      <title>Re: Setting earliest and latest.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Setting-earliest-and-latest/m-p/489705#M136766</link>
      <description>&lt;P&gt;Let me check to see if I understand correctly. Are you looking for your earliest time is be fixed to a date and time, but you want your latest to be a relative time? Either both are fixed or both are relative.&lt;/P&gt;

&lt;P&gt;However, If you are looking for both earliest and latest to be relative, than that's possible. Let's look at 2 hours ago for earliest and then 1 hour and 55 minutes ago (5 minutes after the earliest):&lt;BR /&gt;
 &lt;CODE&gt;earliest=-2h latest=-2h+5m&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2020 17:00:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Setting-earliest-and-latest/m-p/489705#M136766</guid>
      <dc:creator>efavreau</dc:creator>
      <dc:date>2020-01-21T17:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: Setting earliest and latest.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Setting-earliest-and-latest/m-p/489706#M136767</link>
      <description>&lt;P&gt;This is a creative workaround the absolute/relative time modifiers. I don't understand the use case, but bravo.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2020 17:27:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Setting-earliest-and-latest/m-p/489706#M136767</guid>
      <dc:creator>efavreau</dc:creator>
      <dc:date>2020-01-21T17:27:33Z</dc:date>
    </item>
    <item>
      <title>Re: Setting earliest and latest.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Setting-earliest-and-latest/m-p/489707#M136768</link>
      <description>&lt;PRE&gt;&lt;CODE&gt; your_search  [| makeresults 
| eval earliest="1/22/2020:08:00:00"
| eval earliest=strptime(earliest,"%m/%d/%Y:%T")
| eval latest=relative_time(earliest,"+10m")
| format "(" "" "" "" "" ")"]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hi, folks.&lt;BR /&gt;
Making time modifiers, you can take &lt;EM&gt;earliest&lt;/EM&gt; and &lt;EM&gt;latest&lt;/EM&gt; to main search.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2020 23:31:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Setting-earliest-and-latest/m-p/489707#M136768</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-21T23:31:32Z</dc:date>
    </item>
    <item>
      <title>Re: Setting earliest and latest.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Setting-earliest-and-latest/m-p/489708#M136769</link>
      <description>&lt;P&gt;Thank you for your help.&lt;BR /&gt;
I can get the results which I want.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 01:19:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Setting-earliest-and-latest/m-p/489708#M136769</guid>
      <dc:creator>shikata74</dc:creator>
      <dc:date>2020-01-22T01:19:07Z</dc:date>
    </item>
    <item>
      <title>Re: Setting earliest and latest.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Setting-earliest-and-latest/m-p/489709#M136770</link>
      <description>&lt;P&gt;Be sure to "accept as answer" the solution that works for you so that others can benefit,&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 12:59:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Setting-earliest-and-latest/m-p/489709#M136770</guid>
      <dc:creator>jpolvino</dc:creator>
      <dc:date>2020-01-22T12:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: Setting earliest and latest.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Setting-earliest-and-latest/m-p/489710#M136771</link>
      <description>&lt;P&gt;Please advice me,&lt;/P&gt;

&lt;P&gt;I want to use relative time in the "earliest".&lt;BR /&gt;
Because "formtime" in the below is set when clicked in the dashboard.&lt;/P&gt;

&lt;P&gt;I tried below, but I can't get anything.&lt;/P&gt;

&lt;P&gt;my_search  [| makeresults &lt;BR /&gt;
 | eval formtime="1/22/2020:08:00:00"&lt;BR /&gt;
 | eval formtime=strptime(ss,"%m/%d/%Y:%T")&lt;BR /&gt;
 | eval earliest=relative_time(formtime,"-10m")&lt;BR /&gt;
 | eval latest=relative_time(formtime,"+10m")&lt;BR /&gt;
 | format "(" "" "" "" "" ")"]&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:53:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Setting-earliest-and-latest/m-p/489710#M136771</guid>
      <dc:creator>shikata74</dc:creator>
      <dc:date>2020-09-30T03:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: Setting earliest and latest.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Setting-earliest-and-latest/m-p/489711#M136772</link>
      <description>&lt;P&gt;&lt;CODE&gt;| eval formtime=strptime(ss,"%m/%d/%Y:%T")&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;ss&lt;/CODE&gt;?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 08:49:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Setting-earliest-and-latest/m-p/489711#M136772</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-23T08:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: Setting earliest and latest.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Setting-earliest-and-latest/m-p/489712#M136773</link>
      <description>&lt;P&gt;Sorry, &lt;/P&gt;

&lt;P&gt;index=xxx my_search &lt;BR /&gt;
[| makeresults&lt;BR /&gt;
| eval formtime=$time1$&lt;BR /&gt;
| eval formtime=strptime(formtime,"%m/%d/%Y:%T")&lt;BR /&gt;
| eval earliest=relative_time(formtime,"-10m")&lt;BR /&gt;
| eval latest=relative_time(formtime,"+10m")&lt;BR /&gt;
| format "(" "" "" "" "" ")"]&lt;/P&gt;

&lt;P&gt;$time1$ is decided when _time is clicked on the dashboard.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:48:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Setting-earliest-and-latest/m-p/489712#M136773</guid>
      <dc:creator>shikata74</dc:creator>
      <dc:date>2020-09-30T03:48:05Z</dc:date>
    </item>
    <item>
      <title>Re: Setting earliest and latest.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Setting-earliest-and-latest/m-p/489713#M136774</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index=xxx my_search
[| makeresults
| eval formtime=$time1$
| eval earliest=relative_time(formtime,"-10m")
| eval latest=relative_time(formtime,"+10m")
| format "(" "" "" "" "" ")"]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;CODE&gt;$time1$&lt;/CODE&gt; is epoch. do not &lt;CODE&gt;strptime()&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 17:53:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Setting-earliest-and-latest/m-p/489713#M136774</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-23T17:53:48Z</dc:date>
    </item>
    <item>
      <title>Re: Setting earliest and latest.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Setting-earliest-and-latest/m-p/489714#M136775</link>
      <description>&lt;P&gt;Thank you,&lt;/P&gt;

&lt;P&gt;I think earliest and latest are set correctly, but no data was retrieved.&lt;BR /&gt;
( Data in the time range exist definitely. )&lt;/P&gt;

&lt;P&gt;Do u have any idea ?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2020 03:09:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Setting-earliest-and-latest/m-p/489714#M136775</guid>
      <dc:creator>shikata74</dc:creator>
      <dc:date>2020-01-24T03:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: Setting earliest and latest.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Setting-earliest-and-latest/m-p/489715#M136776</link>
      <description>&lt;P&gt;wrong viz, maybe.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2020 09:52:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Setting-earliest-and-latest/m-p/489715#M136776</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-24T09:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: Setting earliest and latest.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Setting-earliest-and-latest/m-p/489716#M136777</link>
      <description>&lt;P&gt;Thank you.&lt;/P&gt;

&lt;P&gt;index=xxxx&lt;BR /&gt;
 [| makeresults&lt;BR /&gt;
 | eval earliest=relative_time($time1$,"-1m")&lt;BR /&gt;
 | eval latest=relative_time($time1$,"+1m")&lt;BR /&gt;
 | format "(" "" "" "" "" ")"]&lt;BR /&gt;
 | table _time&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:54:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Setting-earliest-and-latest/m-p/489716#M136777</guid>
      <dc:creator>shikata74</dc:creator>
      <dc:date>2020-09-30T03:54:47Z</dc:date>
    </item>
  </channel>
</rss>

