<?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: What's the correct search syntax for my earliest and latest date range? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/What-s-the-correct-search-syntax-for-my-earliest-and-latest-date/m-p/170627#M48812</link>
    <description>&lt;P&gt;Yes, the "rehire date" is an extracted field.  The timestamp of the events is a different date as the "rehire date&lt;/P&gt;

&lt;P&gt;to post the sample I'd have to reproduce something fake.  &lt;/P&gt;</description>
    <pubDate>Mon, 09 Mar 2015 06:33:58 GMT</pubDate>
    <dc:creator>kgreat</dc:creator>
    <dc:date>2015-03-09T06:33:58Z</dc:date>
    <item>
      <title>What's the correct search syntax for my earliest and latest date range?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-s-the-correct-search-syntax-for-my-earliest-and-latest-date/m-p/170623#M48808</link>
      <description>&lt;P&gt;For example, I need to search for all rehire dates between 12-01-2014 through 12-31-2014&lt;/P&gt;

&lt;P&gt;"rehire date"=earliest="12/01/2014:00:00:00" latest="12/31/2014:00:00:00" &lt;/P&gt;

&lt;P&gt;What am I doing wrong in the above syntax?  &lt;/P&gt;</description>
      <pubDate>Sun, 08 Mar 2015 08:25:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-s-the-correct-search-syntax-for-my-earliest-and-latest-date/m-p/170623#M48808</guid>
      <dc:creator>kgreat</dc:creator>
      <dc:date>2015-03-08T08:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: What's the correct search syntax for my earliest and latest date range?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-s-the-correct-search-syntax-for-my-earliest-and-latest-date/m-p/170624#M48809</link>
      <description>&lt;P&gt;Drop the equals sign between your string &lt;CODE&gt;"rehire date"&lt;/CODE&gt; and the &lt;CODE&gt;earliest="..."&lt;/CODE&gt; and you should be good.&lt;/P&gt;

&lt;P&gt;Edit: Now that &lt;CODE&gt;rehire_date&lt;/CODE&gt; has been confirmed as an extracted field that's different from &lt;CODE&gt;_time&lt;/CODE&gt;, using the &lt;CODE&gt;earliest&lt;/CODE&gt; and &lt;CODE&gt;latest&lt;/CODE&gt; filters is not going to work. Instead, you'll need to set your time range as wide as necessary to match your event's &lt;CODE&gt;_time&lt;/CODE&gt; values and run a search like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;keywords that identify your events | where rehire_date &amp;gt;= strptime("12/01/2014", "%m/%d/%Y") AND rehire_date &amp;lt; strptime("01/01/2015", "%m/%d/%Y")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note, I have added a day to the end because you mentioned "through 12/31/2014", implying that rehires that happen on the 31st should still be found.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Mar 2015 11:03:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-s-the-correct-search-syntax-for-my-earliest-and-latest-date/m-p/170624#M48809</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-03-08T11:03:21Z</dc:date>
    </item>
    <item>
      <title>Re: What's the correct search syntax for my earliest and latest date range?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-s-the-correct-search-syntax-for-my-earliest-and-latest-date/m-p/170625#M48810</link>
      <description>&lt;P&gt;Remove the equal sign after the "rehire date"  ?&lt;/P&gt;

&lt;P&gt;For example, &lt;/P&gt;

&lt;P&gt;"rehire date" earliest="12/01/2014:00:00:00" latest="12/31/2014:00:00:00" &lt;/P&gt;

&lt;P&gt;Or should I be adding another "="  between&lt;/P&gt;

&lt;P&gt;I'm trying to find all rehires between 12/01/2014 through 12/31/2014.  I'm getting 0 events when I know I should between getting at least 4 people that come up.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Mar 2015 18:27:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-s-the-correct-search-syntax-for-my-earliest-and-latest-date/m-p/170625#M48810</guid>
      <dc:creator>kgreat</dc:creator>
      <dc:date>2015-03-08T18:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: What's the correct search syntax for my earliest and latest date range?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-s-the-correct-search-syntax-for-my-earliest-and-latest-date/m-p/170626#M48811</link>
      <description>&lt;P&gt;Is "rehire date" an extracted field? Is timestamp for your events is same as "rehire date" ? Can you post some sample entries?&lt;/P&gt;</description>
      <pubDate>Sun, 08 Mar 2015 20:17:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-s-the-correct-search-syntax-for-my-earliest-and-latest-date/m-p/170626#M48811</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-03-08T20:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: What's the correct search syntax for my earliest and latest date range?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-s-the-correct-search-syntax-for-my-earliest-and-latest-date/m-p/170627#M48812</link>
      <description>&lt;P&gt;Yes, the "rehire date" is an extracted field.  The timestamp of the events is a different date as the "rehire date&lt;/P&gt;

&lt;P&gt;to post the sample I'd have to reproduce something fake.  &lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2015 06:33:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-s-the-correct-search-syntax-for-my-earliest-and-latest-date/m-p/170627#M48812</guid>
      <dc:creator>kgreat</dc:creator>
      <dc:date>2015-03-09T06:33:58Z</dc:date>
    </item>
    <item>
      <title>Re: What's the correct search syntax for my earliest and latest date range?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-s-the-correct-search-syntax-for-my-earliest-and-latest-date/m-p/170628#M48813</link>
      <description>&lt;P&gt;you have to change the earliest and latest values in the below query and try &lt;/P&gt;

&lt;P&gt;eval begindate="$earliest$"   | eval epochdaystart=if(isnum(begindate), begindate, relative_time(now(), begindate)) | eval epochdaystart= strftime(epochdaystart,"%Y%m%d")   | eval dateepoch=strftime(_time,"%Y%m%d")  | eval latest="$latest$" | eval enddate=if(latest=="now","@d",latest)     | eval epochdayend=if(isnum(enddate), enddate, relative_time(now(), enddate)) | eval epochdayend= strftime(epochdayend,"%Y%m%d")   | where dateepoch &amp;gt;=epochdaystart AND dateepoch &amp;lt;=epochdayend  &lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:07:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-s-the-correct-search-syntax-for-my-earliest-and-latest-date/m-p/170628#M48813</guid>
      <dc:creator>srinathd</dc:creator>
      <dc:date>2020-09-28T19:07:54Z</dc:date>
    </item>
    <item>
      <title>Re: What's the correct search syntax for my earliest and latest date range?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-s-the-correct-search-syntax-for-my-earliest-and-latest-date/m-p/170629#M48814</link>
      <description>&lt;P&gt;I have updated my answer to reflect that the rehire date is in fact not the timestamp of the event but rather an unrelated extracted field.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Mar 2015 20:27:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-s-the-correct-search-syntax-for-my-earliest-and-latest-date/m-p/170629#M48814</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-03-11T20:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: What's the correct search syntax for my earliest and latest date range?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-s-the-correct-search-syntax-for-my-earliest-and-latest-date/m-p/170630#M48815</link>
      <description>&lt;P&gt;Thank you!  I was able to find the correct number of people using the following:&lt;/P&gt;

&lt;P&gt;"Rehire Date"&amp;gt;="2014/12/01 00:00:00" AND "Rehire Date"&amp;lt;"2015/01/01 00:00:00"&lt;/P&gt;</description>
      <pubDate>Sun, 15 Mar 2015 20:25:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-s-the-correct-search-syntax-for-my-earliest-and-latest-date/m-p/170630#M48815</guid>
      <dc:creator>kgreat</dc:creator>
      <dc:date>2015-03-15T20:25:34Z</dc:date>
    </item>
  </channel>
</rss>

