<?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 add days taken from a field to a date field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-days-taken-from-a-field-to-a-date-field/m-p/267888#M80580</link>
    <description>&lt;P&gt;Probably the easiest way is to convert date to epoch in inputDate and then simply multiply countdown by the number of seconds in a day:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval inputDate = strptime(date, "%Y-%m-%d")
| eval expiring = inputDate  + countdown*86400
| eval expiring = strftime(expiring, "%Y-%m-%d")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 21 Jul 2016 08:20:28 GMT</pubDate>
    <dc:creator>javiergn</dc:creator>
    <dc:date>2016-07-21T08:20:28Z</dc:date>
    <item>
      <title>How do I add days taken from a field to a date field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-days-taken-from-a-field-to-a-date-field/m-p/267887#M80579</link>
      <description>&lt;P&gt;I have a field called "date"(2016-07-21)  and a field called "countdown"(e.g. 30) which shows the number of days. How do I add the days to the date?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval inputDate=strptime(date, "%Y-%m-%d") | eval expiring=relative_time(inputDate, "+30d@d") | eval expiring=strftime(expiring,"%Y-%m-%d")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Jul 2016 08:02:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-days-taken-from-a-field-to-a-date-field/m-p/267887#M80579</guid>
      <dc:creator>ZacEsa</dc:creator>
      <dc:date>2016-07-21T08:02:54Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add days taken from a field to a date field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-days-taken-from-a-field-to-a-date-field/m-p/267888#M80580</link>
      <description>&lt;P&gt;Probably the easiest way is to convert date to epoch in inputDate and then simply multiply countdown by the number of seconds in a day:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval inputDate = strptime(date, "%Y-%m-%d")
| eval expiring = inputDate  + countdown*86400
| eval expiring = strftime(expiring, "%Y-%m-%d")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Jul 2016 08:20:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-days-taken-from-a-field-to-a-date-field/m-p/267888#M80580</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-07-21T08:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add days taken from a field to a date field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-days-taken-from-a-field-to-a-date-field/m-p/267889#M80581</link>
      <description>&lt;P&gt;Works perfectly. Thanks! I was trying to find a Splunk feature that'll convert the days to epoch but, I wasn't thinking of just multiplying it. Haha.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2016 08:32:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-days-taken-from-a-field-to-a-date-field/m-p/267889#M80581</guid>
      <dc:creator>ZacEsa</dc:creator>
      <dc:date>2016-07-21T08:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add days taken from a field to a date field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-days-taken-from-a-field-to-a-date-field/m-p/267890#M80582</link>
      <description>&lt;P&gt;I meant to put "+countdown@d" instead of "+30d@d"&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2016 08:34:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-add-days-taken-from-a-field-to-a-date-field/m-p/267890#M80582</guid>
      <dc:creator>ZacEsa</dc:creator>
      <dc:date>2016-07-21T08:34:38Z</dc:date>
    </item>
  </channel>
</rss>

