<?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 convert date string to date format in string and extract all the dates which are 60 and 90 days earlier than the current day? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-date-string-to-date-format-in-string-and-extract/m-p/416900#M119967</link>
    <description>&lt;P&gt;Click &lt;CODE&gt;Accept&lt;/CODE&gt; to close this question and ask another one; let's keep this orderly.  The probably answer to your other question is that you did not configure the email settings (correctly) on the search head.&lt;/P&gt;</description>
    <pubDate>Thu, 18 Apr 2019 13:23:22 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2019-04-18T13:23:22Z</dc:date>
    <item>
      <title>How to convert date string to date format in string and extract all the dates which are 60 and 90 days earlier than the current day?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-date-string-to-date-format-in-string-and-extract/m-p/416897#M119964</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;I am unable to convert date string to date format using below SPL query.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval "-Last Logon Date" = strptime("Last Logon Date", "%m/%d/%Y") | sort "Last Logon Date" | table "User Name", "User Lock Status", "Last Logon Date"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also while sorting it is not properly performing the operation. Please suggest how to extract date values from Last Logon Date column which are 60 or 90 days earlier.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Vineeth Jain&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2019 08:24:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-date-string-to-date-format-in-string-and-extract/m-p/416897#M119964</guid>
      <dc:creator>vineeth_jain</dc:creator>
      <dc:date>2019-04-16T08:24:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert date string to date format in string and extract all the dates which are 60 and 90 days earlier than the current day?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-date-string-to-date-format-in-string-and-extract/m-p/416898#M119965</link>
      <description>&lt;P&gt;There are many things wrong here.  Field names with spaces are EVIL.  Never use &lt;CODE&gt;sort&lt;/CODE&gt; without a number after it (get in the habit of &lt;CODE&gt;sort 0&lt;/CODE&gt; for unlimited).  Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rename "* * * * *" AS *_*_*_*_*, "* * * *" AS *_*_*_*, "* * *" AS *_*_*, "* *" AS *_*
| eval Last_Logon_Date = strptime(Last_Logon_Date, "%m/%d/%Y") 
| where ((Last_Logon_Date &amp;gt;= relative_time(now(), "-90d")) AND (Last_Logon_Date &amp;lt;= relative_time(now(), "-60d")))
| sort 0 - Last_Logon_Date
| fieldformat Last_Logon_Date = strftime(Last_Logon_Date, "%m/%d/%Y")
| table User_Name User_Lock_Status Last_Logon_Date
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Apr 2019 14:29:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-date-string-to-date-format-in-string-and-extract/m-p/416898#M119965</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-04-16T14:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert date string to date format in string and extract all the dates which are 60 and 90 days earlier than the current day?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-date-string-to-date-format-in-string-and-extract/m-p/416899#M119966</link>
      <description>&lt;P&gt;Thanks for your reply and suggestion about field names. It has worked for me.&lt;/P&gt;

&lt;P&gt;Another doubt, how can I export the results of this search using email notification. I have tried alert option but unable to send email notification.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2019 05:26:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-date-string-to-date-format-in-string-and-extract/m-p/416899#M119966</guid>
      <dc:creator>vineeth_jain</dc:creator>
      <dc:date>2019-04-17T05:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert date string to date format in string and extract all the dates which are 60 and 90 days earlier than the current day?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-convert-date-string-to-date-format-in-string-and-extract/m-p/416900#M119967</link>
      <description>&lt;P&gt;Click &lt;CODE&gt;Accept&lt;/CODE&gt; to close this question and ask another one; let's keep this orderly.  The probably answer to your other question is that you did not configure the email settings (correctly) on the search head.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 13:23:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-convert-date-string-to-date-format-in-string-and-extract/m-p/416900#M119967</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-04-18T13:23:22Z</dc:date>
    </item>
  </channel>
</rss>

