<?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: How do I configure a search to count 14 days between now and a timestamp within my event? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-configure-a-search-to-count-14-days-between-now-and-a/m-p/281558#M84974</link>
    <description>&lt;P&gt;Going on your solution, I also evaluated "now" to its own value and limited it by only showing events where the start time is &amp;gt; now&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; yoursearchhere
 | eval start=strptime(PLANNED_START,"%Y-%m-%d %H:%M:%S.%Q") 
 | eval boundaryDate = relative_time(now(),"+14d")
 | eval now=now()
 | where start &amp;lt;= boundaryDate
 | where start &amp;gt; now
 | table whateveryouwant
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 15 Dec 2016 15:07:22 GMT</pubDate>
    <dc:creator>jmaple</dc:creator>
    <dc:date>2016-12-15T15:07:22Z</dc:date>
    <item>
      <title>How do I configure a search to count 14 days between now and a timestamp within my event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-configure-a-search-to-count-14-days-between-now-and-a/m-p/281553#M84969</link>
      <description>&lt;P&gt;We've ingested some database tables for data that consists of changes being made in our environment. I'm looking to create a report that counts out two weeks at a time to find the next tasks that will occur. The timestamp we are reading is its own column so I evaluated that timestamp to a date and evaluated now.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[base search] | eval start=strptime(PLANNED_START,"%Y-%m-%d %H:%M:%S.%Q") | eval startDate=strftime(start,"%Y-%m-%d") | eval now=now()| eval todayDate=strftime(now,"%Y-%m-%d") | [table output]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;From here, I want to be able to evaluate 14 days between "todayDate" and "startDate". What would be the best way to achieve this?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2016 21:45:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-configure-a-search-to-count-14-days-between-now-and-a/m-p/281553#M84969</guid>
      <dc:creator>jmaple</dc:creator>
      <dc:date>2016-12-14T21:45:56Z</dc:date>
    </item>
    <item>
      <title>Re: How do I configure a search to count 14 days between now and a timestamp within my event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-configure-a-search-to-count-14-days-between-now-and-a/m-p/281554#M84970</link>
      <description>&lt;P&gt;First, "find the next tasks that will occur" sounds like you are looking for future events. And I don't know what "evaluate 14 days" means either.&lt;BR /&gt;
Can you explain your input and your desired output?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2016 23:10:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-configure-a-search-to-count-14-days-between-now-and-a/m-p/281554#M84970</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2016-12-14T23:10:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do I configure a search to count 14 days between now and a timestamp within my event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-configure-a-search-to-count-14-days-between-now-and-a/m-p/281555#M84971</link>
      <description>&lt;P&gt;So the PLANNED_START field is a column from a table in which a user inputs the value of when they plan to start the task (the task being the whole event itself). I'm trying to create a report that reads the "startDate" field and determines if the date is within the next two weeks from when the report is ran.&lt;/P&gt;

&lt;P&gt;Ideally this would be run every morning and show two weeks of tasks from that moment (todayDate). &lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2016 23:43:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-configure-a-search-to-count-14-days-between-now-and-a/m-p/281555#M84971</guid>
      <dc:creator>jmaple</dc:creator>
      <dc:date>2016-12-14T23:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: How do I configure a search to count 14 days between now and a timestamp within my event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-configure-a-search-to-count-14-days-between-now-and-a/m-p/281556#M84972</link>
      <description>&lt;P&gt;So, based on the comment, here is how to do what you want.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yoursearchhere
| eval start=strptime(PLANNED_START,"%Y-%m-%d %H:%M:%S.%Q") 
| eval boundaryDate = relative_time(now(),"+14d")
| where start &amp;lt;= boundaryDate
| table whateveryouwant
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The relative_time function is super useful...&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2016 01:29:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-configure-a-search-to-count-14-days-between-now-and-a/m-p/281556#M84972</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2016-12-15T01:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: How do I configure a search to count 14 days between now and a timestamp within my event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-configure-a-search-to-count-14-days-between-now-and-a/m-p/281557#M84973</link>
      <description>&lt;P&gt;Doesn't seem to have the desired effect. It does cut the number of events down so it's doing something but it doesn't seem to be limited to the 14 days I want it to be limited to.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2016 03:31:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-configure-a-search-to-count-14-days-between-now-and-a/m-p/281557#M84973</guid>
      <dc:creator>jmaple</dc:creator>
      <dc:date>2016-12-15T03:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: How do I configure a search to count 14 days between now and a timestamp within my event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-configure-a-search-to-count-14-days-between-now-and-a/m-p/281558#M84974</link>
      <description>&lt;P&gt;Going on your solution, I also evaluated "now" to its own value and limited it by only showing events where the start time is &amp;gt; now&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; yoursearchhere
 | eval start=strptime(PLANNED_START,"%Y-%m-%d %H:%M:%S.%Q") 
 | eval boundaryDate = relative_time(now(),"+14d")
 | eval now=now()
 | where start &amp;lt;= boundaryDate
 | where start &amp;gt; now
 | table whateveryouwant
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Dec 2016 15:07:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-configure-a-search-to-count-14-days-between-now-and-a/m-p/281558#M84974</guid>
      <dc:creator>jmaple</dc:creator>
      <dc:date>2016-12-15T15:07:22Z</dc:date>
    </item>
  </channel>
</rss>

