<?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 to create a new date field with a value that is 90 days after the value in another date field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-date-field-with-a-value-that-is-90-days/m-p/139215#M38250</link>
    <description>&lt;P&gt;source="dbmon-tail://idwarehouse/idw_account" application=TFAYD [|inputlookup execSSO.csv |rename sso as owner] |eval exp_date=strftime(relative_time(now(),"+90d@d"), "%Y/%m/%d %H:%M") |rename lastPasswordChange as lastpasswordchangedate&lt;/P&gt;

&lt;P&gt;This is search is calculating the exp date is 90 days from today date .  I am trying to get lastPasswordChange date  to 90days exp date.&lt;/P&gt;

&lt;P&gt;my output, &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;application =TFAYD
exp_date =2014/12/25 00:00
lastpasswordchangedate =2014-08-06 11:11:43
owner =501936069
refreshedDate =2014-09-26 12:16:36
sourcetype =mysql 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The now() command is returning the current date , so this query is returning the exp_date =2014/12/25 00:00 ,  i want to return lastpasswordchangedate, so that i will get exp date 90days calculating from lastpasswordchangedate .  &lt;/P&gt;

&lt;P&gt;lastpasswordchangedate is a one of the field in splunk ,  i want to return this field value in splunk (lastpasswordchangedate =2014-08-06 11:11:43) , so that i can get the exp_date  value 90days from the lastpasswordchange date , &lt;/P&gt;

&lt;P&gt;in the same place , instead of  now() , if i place lastpasswordchangedate it is not returning the lastpasswordchangedate value ...&lt;/P&gt;

&lt;P&gt;any one can help on this ..... &lt;/P&gt;

&lt;P&gt;Thanks and Regards,&lt;BR /&gt;
Siraj&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 17:43:09 GMT</pubDate>
    <dc:creator>siraj198204</dc:creator>
    <dc:date>2020-09-28T17:43:09Z</dc:date>
    <item>
      <title>How to create a new date field with a value that is 90 days after the value in another date field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-date-field-with-a-value-that-is-90-days/m-p/139206#M38241</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;

&lt;P&gt;Similarly ,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="dbmo-tail://idware/id_account" application=TFD [|inputlookup execSSO.csv |rename sso as owner] |fields source,Lastpasswordchangedate
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The above query is working good.&lt;/P&gt;

&lt;P&gt;I have the last passwordchangedate field , it is showing the date for lastpasswordchange date. by using this field  i want to determine new field for password expire date . expire date time 90 days .&lt;/P&gt;

&lt;P&gt;any one can help me on this .&lt;/P&gt;</description>
      <pubDate>Wed, 24 Sep 2014 19:58:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-date-field-with-a-value-that-is-90-days/m-p/139206#M38241</guid>
      <dc:creator>siraj198204</dc:creator>
      <dc:date>2014-09-24T19:58:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a new date field with a value that is 90 days after the value in another date field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-date-field-with-a-value-that-is-90-days/m-p/139207#M38242</link>
      <description>&lt;P&gt;What is the format of date in the field Lastpasswordchangedate? &lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;&lt;P&gt;If its a epoch time, then try this&lt;/P&gt;

&lt;P&gt;source="dbmo-tail://idware/id_account" application=TFD [|inputlookup execSSO.csv |rename sso as owner] |fields source,Lastpasswordchangedate | eval Nextpasswordchangedate=relative_time(Lastpasswordchangedate,"+90d")&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;If its a string format date with fixed format, e.g. %Y/%m/%d %H:%M, then try this&lt;/P&gt;

&lt;P&gt;source="dbmo-tail://idware/id_account" application=TFD [|inputlookup execSSO.csv |rename sso as owner] |fields source,Lastpasswordchangedate | eval Nextpasswordchangedate=strftime(relative_time(strptime(Lastpasswordchangedate,"%Y/%m/%d %H:%M"),"+90d"),"%Y/%m/%d %H:%M")&lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:41:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-date-field-with-a-value-that-is-90-days/m-p/139207#M38242</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2020-09-28T17:41:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a new date field with a value that is 90 days after the value in another date field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-date-field-with-a-value-that-is-90-days/m-p/139208#M38243</link>
      <description>&lt;P&gt;I was just about to post the same thing, I am pretty sure he isn't using epoch time, so your second option is what he will want to use, but I think you can remove the strptime and just have the below.&lt;/P&gt;

&lt;P&gt;eval exp_date=strftime(relative_time(Lastpasswordchangedate, "+90d@d"), "%m/%d/%Y")&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:41:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-date-field-with-a-value-that-is-90-days/m-p/139208#M38243</guid>
      <dc:creator>icyfeverr</dc:creator>
      <dc:date>2020-09-28T17:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a new date field with a value that is 90 days after the value in another date field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-date-field-with-a-value-that-is-90-days/m-p/139209#M38244</link>
      <description>&lt;P&gt;I am not  getting any errors, while running this query , but i am not able to see field  like Nextpasswordchangedate  in the output . now trying to show is  Nextpasswordchangedate field as visible . &lt;/P&gt;

&lt;P&gt;The below fields are visible . &lt;BR /&gt;
application =TFD&lt;BR /&gt;
lastPasswordChange =2014-08-06 11:06:44&lt;BR /&gt;
owner =206047890&lt;/P&gt;</description>
      <pubDate>Thu, 25 Sep 2014 12:19:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-date-field-with-a-value-that-is-90-days/m-p/139209#M38244</guid>
      <dc:creator>siraj198204</dc:creator>
      <dc:date>2014-09-25T12:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a new date field with a value that is 90 days after the value in another date field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-date-field-with-a-value-that-is-90-days/m-p/139210#M38245</link>
      <description>&lt;P&gt;Thank  for your help , &lt;/P&gt;

&lt;P&gt;i have ran this query , but it is not showing the nextpasswordchangedate field in output .   i have set as a nextpassword change date is visible , it is has to show number of days for password expiry date , &lt;/P&gt;

&lt;P&gt;example , password expire date today is 90 , tomorrow is 89, 88,87.  we need to get the Number of days till password expire ... day by it can reduce ... 86,85.  that output  and password expire date it should be visible... &lt;/P&gt;

&lt;P&gt;once again thanks for a help ... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Siraj&lt;/P&gt;</description>
      <pubDate>Thu, 25 Sep 2014 12:46:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-date-field-with-a-value-that-is-90-days/m-p/139210#M38245</guid>
      <dc:creator>siraj198204</dc:creator>
      <dc:date>2014-09-25T12:46:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a new date field with a value that is 90 days after the value in another date field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-date-field-with-a-value-that-is-90-days/m-p/139211#M38246</link>
      <description>&lt;P&gt;Try the below at the end of your original search:&lt;/P&gt;

&lt;P&gt;| eval exp_date=relative_time(Lastpasswordchangedate, "+90d@d") | eval exp_days=floor((exp_date-Lastpasswordchangedate)/86400)&lt;/P&gt;

&lt;P&gt;If the above does not work, please copy and paste your entire search and provide a screenshot,&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:42:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-date-field-with-a-value-that-is-90-days/m-p/139211#M38246</guid>
      <dc:creator>icyfeverr</dc:creator>
      <dc:date>2020-09-28T17:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a new date field with a value that is 90 days after the value in another date field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-date-field-with-a-value-that-is-90-days/m-p/139212#M38247</link>
      <description>&lt;P&gt;source="dbmon-tail://idwarehouse/idw_account" application=TFAYD [|inputlookup execSSO.csv |rename sso as owner]  |eval exp_date=strftime(relative_time(lastPasswordChange, "+90d@d"), "%y-%m-%d") | eval exp_days=floor((exp_date-lastpasswordchange)/86400) &lt;/P&gt;

&lt;P&gt;my output , &lt;BR /&gt;
application =TFAYD&lt;BR /&gt;
lastPasswordChange =2014-09-21 13:43:32&lt;BR /&gt;
owner =206047117&lt;BR /&gt;
refreshedDate =2014-09-25 09:14:52&lt;BR /&gt;
sourcetype =mysql &lt;/P&gt;

&lt;P&gt;if suppose i change the value to lastPasswordChangedate (dupilcate)  i am getting exp date output is &lt;/P&gt;

&lt;P&gt;application =TFAYD&lt;BR /&gt;
exp_date =04-10-14   =&amp;gt;  actually it has to come =&amp;gt; 2014-12-21 13:43:52 &lt;BR /&gt;
lastPasswordChange =2014-09-21 13:43:32&lt;BR /&gt;
owner =206047117&lt;BR /&gt;
refreshedDate =2014-09-25 09:14:52&lt;BR /&gt;
sourcetype =mysql &lt;/P&gt;

&lt;P&gt;Thanks for a help , actually my field is  lastPasswordChange(original) , if i change this to lastPasswordChangedate like this i am getting the expire date output but it wrong ..&lt;/P&gt;

&lt;P&gt;exp_date =04-10-14  ("%y-%m-%d") output is wrong ...&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:42:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-date-field-with-a-value-that-is-90-days/m-p/139212#M38247</guid>
      <dc:creator>siraj198204</dc:creator>
      <dc:date>2020-09-28T17:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a new date field with a value that is 90 days after the value in another date field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-date-field-with-a-value-that-is-90-days/m-p/139213#M38248</link>
      <description>&lt;P&gt;query 1&lt;BR /&gt;
source="dbmon-tail://idwarehouse/idw_account" application=TFAYD [|inputlookup execSSO.csv |rename sso as owner]  | eval exp_date=strftime(relative_time(strptime(lastPasswordChange,"%Y/%m/%d %H:%M"),"+90d"),"%Y/%m/%d %H:%M")&lt;/P&gt;

&lt;P&gt;query 2&lt;BR /&gt;
source="dbmon-tail://idwarehouse/idw_account" application=TFAYD [|inputlookup execSSO.csv |rename sso as owner]  | eval exp_date=relative_time(lastPasswordChange, "+90d@d") | eval exp_days=floor((exp_date-lastPasswordChange)/86400)&lt;/P&gt;

&lt;P&gt;my output ,&lt;BR /&gt;
application =TFAYD&lt;BR /&gt;
lastPasswordChange =2014-09-21 13:43:32&lt;BR /&gt;
owner =206047117&lt;BR /&gt;
refreshedDate =2014-09-25 09:14:52&lt;BR /&gt;
sourcetype =mysql &lt;/P&gt;

&lt;P&gt;I am not getting the output for  exp_date and exp_day . any one can help me on this . &lt;/P&gt;

&lt;P&gt;Thanks in advance ....  &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;BR /&gt;
The original field is lastPasswordChange . &lt;BR /&gt;
i modified the lastPasswordChange to lastPasswordChangedate , then i am getting the wrong output , &lt;/P&gt;

&lt;P&gt;exp_date =2004-10-14    it is wrong ,  correct output is 2014-12-21 13:43:32  ( 90 days)&lt;/P&gt;

&lt;P&gt;Thanks for a help ... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:42:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-date-field-with-a-value-that-is-90-days/m-p/139213#M38248</guid>
      <dc:creator>siraj198204</dc:creator>
      <dc:date>2020-09-28T17:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a new date field with a value that is 90 days after the value in another date field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-date-field-with-a-value-that-is-90-days/m-p/139214#M38249</link>
      <description>&lt;P&gt;Hi , &lt;/P&gt;

&lt;P&gt;source="dbmon-tail://idwarehouse/idw_account" application=TFAYD [|inputlookup execSSO.csv |rename sso as owner] | eval exp_date=strftime(relative_time(Lastpasswordchangedate,"+90d@d"), "%Y-%m-%d %H:%M")   |rename lastPasswordChange AS Lastpasswordchangedate&lt;/P&gt;

&lt;P&gt;this query is working good, &lt;BR /&gt;
my output ,&lt;/P&gt;

&lt;P&gt;Lastpasswordchangedate =2014-08-06 11:11:43&lt;BR /&gt;
application =TFAYD&lt;BR /&gt;
exp_date =2004-09-28 00:00&lt;BR /&gt;
owner =501936069&lt;BR /&gt;
refreshedDate =2014-09-26 06:15:18&lt;BR /&gt;
sourcetype =mysql &lt;/P&gt;

&lt;P&gt;but i need the exp_date output is=2014-11-06 11:11:43   (90 days from the lastpasswordchangedate)&lt;/P&gt;

&lt;P&gt;any one can help me on this ... ,source="dbmon-tail://idwarehouse/idw_account" application=TFAYD [|inputlookup execSSO.csv |rename sso as owner] | eval exp_date=strftime(relative_time(Lastpasswordchangedate,"+90d@d"), "%Y-%m-%d %H:%M")   |rename lastPasswordChange AS Lastpasswordchangedate&lt;/P&gt;

&lt;P&gt;The above query is working good, &lt;/P&gt;

&lt;P&gt;my output ,&lt;/P&gt;

&lt;P&gt;Lastpasswordchangedate =2014-08-06 11:11:43&lt;BR /&gt;
application =TFAYD&lt;BR /&gt;
exp_date =2004-09-28 00:00&lt;BR /&gt;
owner =501936069&lt;BR /&gt;
refreshedDate =2014-09-26 06:15:18&lt;BR /&gt;
sourcetype =mysql &lt;/P&gt;

&lt;P&gt;But i need the exp_date output is 2014-11-06 11:11:43  (90 days from the lastpassword change date )&lt;/P&gt;

&lt;H2&gt;any one can help me on this &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/H2&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:42:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-date-field-with-a-value-that-is-90-days/m-p/139214#M38249</guid>
      <dc:creator>siraj198204</dc:creator>
      <dc:date>2020-09-28T17:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a new date field with a value that is 90 days after the value in another date field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-date-field-with-a-value-that-is-90-days/m-p/139215#M38250</link>
      <description>&lt;P&gt;source="dbmon-tail://idwarehouse/idw_account" application=TFAYD [|inputlookup execSSO.csv |rename sso as owner] |eval exp_date=strftime(relative_time(now(),"+90d@d"), "%Y/%m/%d %H:%M") |rename lastPasswordChange as lastpasswordchangedate&lt;/P&gt;

&lt;P&gt;This is search is calculating the exp date is 90 days from today date .  I am trying to get lastPasswordChange date  to 90days exp date.&lt;/P&gt;

&lt;P&gt;my output, &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;application =TFAYD
exp_date =2014/12/25 00:00
lastpasswordchangedate =2014-08-06 11:11:43
owner =501936069
refreshedDate =2014-09-26 12:16:36
sourcetype =mysql 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The now() command is returning the current date , so this query is returning the exp_date =2014/12/25 00:00 ,  i want to return lastpasswordchangedate, so that i will get exp date 90days calculating from lastpasswordchangedate .  &lt;/P&gt;

&lt;P&gt;lastpasswordchangedate is a one of the field in splunk ,  i want to return this field value in splunk (lastpasswordchangedate =2014-08-06 11:11:43) , so that i can get the exp_date  value 90days from the lastpasswordchange date , &lt;/P&gt;

&lt;P&gt;in the same place , instead of  now() , if i place lastpasswordchangedate it is not returning the lastpasswordchangedate value ...&lt;/P&gt;

&lt;P&gt;any one can help on this ..... &lt;/P&gt;

&lt;P&gt;Thanks and Regards,&lt;BR /&gt;
Siraj&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:43:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-new-date-field-with-a-value-that-is-90-days/m-p/139215#M38250</guid>
      <dc:creator>siraj198204</dc:creator>
      <dc:date>2020-09-28T17:43:09Z</dc:date>
    </item>
  </channel>
</rss>

