<?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: Need to eval date range instead of relative time from custom time field. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Need-to-eval-date-range-instead-of-relative-time-from-custom/m-p/350591#M103787</link>
    <description>&lt;P&gt;If you're trying to compare against the specific/static dates, do like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | eval _time=strptime(ProjCreatedDate,"%Y-%m-%d %H:%M:%S")
| where _time&amp;gt;=strptime("1/1/2017","%m/%d/%Y") AND _time&amp;lt;=strptime("5/21/2017","%m/%d/%Y") 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 19 Sep 2017 21:40:04 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2017-09-19T21:40:04Z</dc:date>
    <item>
      <title>Need to eval date range instead of relative time from custom time field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-eval-date-range-instead-of-relative-time-from-custom/m-p/350586#M103782</link>
      <description>&lt;P&gt;I am currently using this method to use date from custom field for relative time frames which only gives me 3 months.&lt;/P&gt;

&lt;P&gt;| eval NewTime=strptime(ProjCreatedDate,"%Y-%m-%d %H:%M:%S")&lt;BR /&gt;
| eval _time=NewTime&lt;BR /&gt;
| where _time&amp;gt;=relative_time(now(),"-3mon") AND _time&lt;/P&gt;

&lt;P&gt;I need to get instead of relative time Last 3 months I need a time range.. From 1/1/2017 to 5/21/2017.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:53:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-eval-date-range-instead-of-relative-time-from-custom/m-p/350586#M103782</guid>
      <dc:creator>matt4321</dc:creator>
      <dc:date>2020-09-29T15:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: Need to eval date range instead of relative time from custom time field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-eval-date-range-instead-of-relative-time-from-custom/m-p/350587#M103783</link>
      <description>&lt;P&gt;Hi matt4321,&lt;BR /&gt;
try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your_search
| eval NewTime=strptime(ProjCreatedDate,"%Y-%m-%d %H:%M:%S")
| where NewTime&amp;gt;=relative_time(now(),"-3mon") 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I didn't understood the second condition "AND _time"&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2017 15:33:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-eval-date-range-instead-of-relative-time-from-custom/m-p/350587#M103783</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-09-19T15:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: Need to eval date range instead of relative time from custom time field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-eval-date-range-instead-of-relative-time-from-custom/m-p/350588#M103784</link>
      <description>&lt;P&gt;Can you explain your requirement more, possibly with an example of what you currently get and what you expect?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2017 15:35:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-eval-date-range-instead-of-relative-time-from-custom/m-p/350588#M103784</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-09-19T15:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: Need to eval date range instead of relative time from custom time field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-eval-date-range-instead-of-relative-time-from-custom/m-p/350589#M103785</link>
      <description>&lt;P&gt;Yes sorry for some reason this posted with my bottom question not in there.  I need to get instead of relative time Last 3 months I need a time range..  From 1/1/2017 to 5/21/2017.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2017 15:42:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-eval-date-range-instead-of-relative-time-from-custom/m-p/350589#M103785</guid>
      <dc:creator>matt4321</dc:creator>
      <dc:date>2017-09-19T15:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: Need to eval date range instead of relative time from custom time field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-eval-date-range-instead-of-relative-time-from-custom/m-p/350590#M103786</link>
      <description>&lt;P&gt;Awesome I was wondering about that as well.. I will remove it and see how it goes.&lt;/P&gt;

&lt;P&gt;Do you know about the updated comment?&lt;BR /&gt;
"I need to get instead of relative time Last 3 months I need a time range.. From 1/1/2017 to 5/21/2017."&lt;/P&gt;

&lt;P&gt;Any help would be appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2017 20:24:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-eval-date-range-instead-of-relative-time-from-custom/m-p/350590#M103786</guid>
      <dc:creator>matt4321</dc:creator>
      <dc:date>2017-09-19T20:24:13Z</dc:date>
    </item>
    <item>
      <title>Re: Need to eval date range instead of relative time from custom time field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-eval-date-range-instead-of-relative-time-from-custom/m-p/350591#M103787</link>
      <description>&lt;P&gt;If you're trying to compare against the specific/static dates, do like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | eval _time=strptime(ProjCreatedDate,"%Y-%m-%d %H:%M:%S")
| where _time&amp;gt;=strptime("1/1/2017","%m/%d/%Y") AND _time&amp;lt;=strptime("5/21/2017","%m/%d/%Y") 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Sep 2017 21:40:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-eval-date-range-instead-of-relative-time-from-custom/m-p/350591#M103787</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-09-19T21:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: Need to eval date range instead of relative time from custom time field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-eval-date-range-instead-of-relative-time-from-custom/m-p/350592#M103788</link>
      <description>&lt;P&gt;as suggested by @somesoni2 modify the where condition with&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| where _time&amp;gt;=strptime("1/1/2017","%m/%d/%Y") AND _time&amp;lt;=strptime("5/21/2017","%m/%d/%Y") 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2017 09:20:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-eval-date-range-instead-of-relative-time-from-custom/m-p/350592#M103788</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-09-20T09:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: Need to eval date range instead of relative time from custom time field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-eval-date-range-instead-of-relative-time-from-custom/m-p/350593#M103789</link>
      <description>&lt;P&gt;If this answer satisfies your question, please accept or upvote it.&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2017 11:10:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-eval-date-range-instead-of-relative-time-from-custom/m-p/350593#M103789</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-09-20T11:10:03Z</dc:date>
    </item>
    <item>
      <title>Re: Need to eval date range instead of relative time from custom time field.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-to-eval-date-range-instead-of-relative-time-from-custom/m-p/350594#M103790</link>
      <description>&lt;P&gt;This worked perfect Thank you very much!!  Trying to change this to the answer now.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2017 13:52:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-to-eval-date-range-instead-of-relative-time-from-custom/m-p/350594#M103790</guid>
      <dc:creator>matt4321</dc:creator>
      <dc:date>2017-09-20T13:52:27Z</dc:date>
    </item>
  </channel>
</rss>

