<?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 Can I control earliest and latest date using fixed dates? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-I-control-earliest-and-latest-date-using-fixed-dates/m-p/227179#M67078</link>
    <description>&lt;P&gt;I have 2 searches that I am appending that looks something like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search1 | append [search search2]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and basically search 1 has data for 6 months e.g. Jan-Jun and search 2 has data for 6 months e.g.Jun-Nov.&lt;/P&gt;

&lt;P&gt;Can I control search1 to search for all dates up to June 15th at midnight using latest?&lt;/P&gt;

&lt;P&gt;And can I control search2 to search for all dates from June 15th at midnight using earliest? This way from a graphing point of view they all line up.&lt;/P&gt;

&lt;P&gt;This way my earch would look something like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search1 latest=20140615 | append [search search2 earliest=20140616 ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;NOTE&lt;/STRONG&gt; I have asked this &lt;A href="https://answers.splunk.com/answers/232425/can-i-control-earliest-and-latest-date-using-fixed.html"&gt;Q&lt;/A&gt; before but sollution I found then was &lt;CODE&gt;starttime= 03/16/2015:00:00:00&lt;/CODE&gt; but that is now &lt;A href="https://answers.splunk.com/answers/374069/what-format-should-timestamp-be-in-for-starttime.html"&gt;deprecated&lt;/A&gt; so I am looking for a better solution.&lt;/P&gt;</description>
    <pubDate>Wed, 02 Mar 2016 19:49:03 GMT</pubDate>
    <dc:creator>HattrickNZ</dc:creator>
    <dc:date>2016-03-02T19:49:03Z</dc:date>
    <item>
      <title>Can I control earliest and latest date using fixed dates?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-control-earliest-and-latest-date-using-fixed-dates/m-p/227179#M67078</link>
      <description>&lt;P&gt;I have 2 searches that I am appending that looks something like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search1 | append [search search2]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and basically search 1 has data for 6 months e.g. Jan-Jun and search 2 has data for 6 months e.g.Jun-Nov.&lt;/P&gt;

&lt;P&gt;Can I control search1 to search for all dates up to June 15th at midnight using latest?&lt;/P&gt;

&lt;P&gt;And can I control search2 to search for all dates from June 15th at midnight using earliest? This way from a graphing point of view they all line up.&lt;/P&gt;

&lt;P&gt;This way my earch would look something like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search1 latest=20140615 | append [search search2 earliest=20140616 ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;NOTE&lt;/STRONG&gt; I have asked this &lt;A href="https://answers.splunk.com/answers/232425/can-i-control-earliest-and-latest-date-using-fixed.html"&gt;Q&lt;/A&gt; before but sollution I found then was &lt;CODE&gt;starttime= 03/16/2015:00:00:00&lt;/CODE&gt; but that is now &lt;A href="https://answers.splunk.com/answers/374069/what-format-should-timestamp-be-in-for-starttime.html"&gt;deprecated&lt;/A&gt; so I am looking for a better solution.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2016 19:49:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-control-earliest-and-latest-date-using-fixed-dates/m-p/227179#M67078</guid>
      <dc:creator>HattrickNZ</dc:creator>
      <dc:date>2016-03-02T19:49:03Z</dc:date>
    </item>
    <item>
      <title>Re: Can I control earliest and latest date using fixed dates?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-I-control-earliest-and-latest-date-using-fixed-dates/m-p/227180#M67079</link>
      <description>&lt;P&gt;Since you're hardcoding the dates anyways, so I would suggest to provide the epoch equivalent time for latest and earliest, like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;1402894800 - 6/16/2014, 12:00:00 AM GMT-5:00

search1 latest=1402894800| append [search search2 earliest=1402894800 ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you still want to use a human readable format, then you can use subsearches like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    search1 [| gentimes start=-1 | eval latest=strptime("20140616","%Y%m%d") | table latest ]
  | append [search search2 [| gentimes start=-1 | eval earliest=strptime("20140616","%Y%m%d") | table earliest]]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Mar 2016 20:08:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-I-control-earliest-and-latest-date-using-fixed-dates/m-p/227180#M67079</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-03-02T20:08:42Z</dc:date>
    </item>
  </channel>
</rss>

