<?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 converting lastLogonTimestamp to readable date and time format in Splunk in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/converting-lastLogonTimestamp-to-readable-date-and-time-format/m-p/222873#M65553</link>
    <description>&lt;P&gt;My ldap search for last logon (Active Directory) displays time in a format that makes it harder to read. How can I make the time to be represented as MM-DD-YYYY and XX:XX AM OR PM format? Below is a sample output. Thanks&lt;/P&gt;

&lt;P&gt;lastLogonTimestamp:  2015-09-09T19:27:23.641679Z &lt;/P&gt;</description>
    <pubDate>Fri, 11 Sep 2015 20:28:17 GMT</pubDate>
    <dc:creator>samble</dc:creator>
    <dc:date>2015-09-11T20:28:17Z</dc:date>
    <item>
      <title>converting lastLogonTimestamp to readable date and time format in Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/converting-lastLogonTimestamp-to-readable-date-and-time-format/m-p/222873#M65553</link>
      <description>&lt;P&gt;My ldap search for last logon (Active Directory) displays time in a format that makes it harder to read. How can I make the time to be represented as MM-DD-YYYY and XX:XX AM OR PM format? Below is a sample output. Thanks&lt;/P&gt;

&lt;P&gt;lastLogonTimestamp:  2015-09-09T19:27:23.641679Z &lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2015 20:28:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/converting-lastLogonTimestamp-to-readable-date-and-time-format/m-p/222873#M65553</guid>
      <dc:creator>samble</dc:creator>
      <dc:date>2015-09-11T20:28:17Z</dc:date>
    </item>
    <item>
      <title>Re: converting lastLogonTimestamp to readable date and time format in Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/converting-lastLogonTimestamp-to-readable-date-and-time-format/m-p/222874#M65554</link>
      <description>&lt;P&gt;Assuming the lastLogonTimestamp is an extracted field, try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;..your base search | eval lastLogonTimestamp =strftime(strptime(lastLogonTimestamp,"%Y-%m-%dT%H:%M:%S.%QZ"),"%m-%d-%Y %H:%M %p")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Tested by this runanywhere search sample&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| gentimes start=-1 |eval lastLogonTimestamp ="2015-09-09T19:27:23.641679Z" | eval lastLogonTimestamp =strftime(strptime(lastLogonTimestamp,"%Y-%m-%dT%H:%M:%S.%QZ"),"%m-%d-%Y %H:%M %p")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 11 Sep 2015 20:36:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/converting-lastLogonTimestamp-to-readable-date-and-time-format/m-p/222874#M65554</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-09-11T20:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: converting lastLogonTimestamp to readable date and time format in Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/converting-lastLogonTimestamp-to-readable-date-and-time-format/m-p/222875#M65555</link>
      <description>&lt;P&gt;Thanks for the timely response, it worked. The lastlogonTimestamp is an extracted field&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2015 21:03:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/converting-lastLogonTimestamp-to-readable-date-and-time-format/m-p/222875#M65555</guid>
      <dc:creator>samble</dc:creator>
      <dc:date>2015-09-11T21:03:21Z</dc:date>
    </item>
  </channel>
</rss>

