<?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: Zulu time in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Zulu-time/m-p/685902#M114393</link>
    <description>&lt;P&gt;Are you saying you want to remove the milliseconds and timezone specifier or are you saying that your epoch time does not convert correctly, as this time in your message&amp;nbsp;&lt;SPAN&gt;1714363262.904000&amp;nbsp; is not actually the time&amp;nbsp;2024-04-29T12:01:15.710Z&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;When you use strptime to parse that time, you will get a time in your local time. If you are in GMT then it is the same, but here in Australia, I get a time that represents&amp;nbsp;&lt;SPAN&gt;2024-04-29 22:01:15.710 AEST, i.e. 10 hours later than the Zulu time.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you are just looking to remove the milliseconds and time zone indicator, then just reformat using&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval latest_time=strftime(strptime(latest_time, "%FT%T.%Q%Z"), "%F %T")&lt;/LI-CODE&gt;&lt;P&gt;Note that %F is shorthand for %Y-%m-%d and %T is a shortcut for %H:%M:%S&lt;/P&gt;&lt;P&gt;Note that that new time will be in your local time.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you don't care about time zones at all and simply want to remove the T, milliseconds and Z then you could just use sed, i.e.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex mode=sed field=latest_time "s/\.\d+Z// s/T/ /"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 30 Apr 2024 00:18:01 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2024-04-30T00:18:01Z</dc:date>
    <item>
      <title>Zulu time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Zulu-time/m-p/685867#M114389</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;i read many topics on zulu time but i m not able to solde one&lt;/P&gt;&lt;P&gt;i have a date in this way&amp;nbsp;&lt;SPAN&gt;2024-04-29T12:01:15.710Z i just want it&amp;nbsp; this way YYYY-MM-DD HH:MM:SS.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;i trie this&amp;nbsp;&lt;/SPAN&gt;eval latest_time = strptime(latest_time, "%Y-%m-%dT%H:%M:%S.%3N%Z")&lt;/P&gt;&lt;P&gt;and the result is that :&amp;nbsp;&lt;SPAN&gt;1714363262.904000&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;i really don't catch the proble!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Laurent&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Apr 2024 16:14:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Zulu-time/m-p/685867#M114389</guid>
      <dc:creator>Laurent</dc:creator>
      <dc:date>2024-04-29T16:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: Zulu time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Zulu-time/m-p/685887#M114392</link>
      <description>&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;strptime&lt;/FONT&gt; function converts a timestamp from text format into integer (epoch) format.&amp;nbsp; To convert from one text format into another, use a combination of &lt;FONT face="courier new,courier"&gt;strptime&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;strftime&lt;/FONT&gt; (which converts epochs into text).&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval latest_time = strftime(strptime(latest_time, "%Y-%m-%dT%H:%M:%S.%3N%Z"), "%Y-%m-%d %H:%M:%S.%3N%Z")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Or you could use SED to replace the "T" with a space.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex mode=sed field=latest_time "s/(\d)T(\d)/\1 \2/"&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 29 Apr 2024 20:12:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Zulu-time/m-p/685887#M114392</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2024-04-29T20:12:47Z</dc:date>
    </item>
    <item>
      <title>Re: Zulu time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Zulu-time/m-p/685902#M114393</link>
      <description>&lt;P&gt;Are you saying you want to remove the milliseconds and timezone specifier or are you saying that your epoch time does not convert correctly, as this time in your message&amp;nbsp;&lt;SPAN&gt;1714363262.904000&amp;nbsp; is not actually the time&amp;nbsp;2024-04-29T12:01:15.710Z&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;When you use strptime to parse that time, you will get a time in your local time. If you are in GMT then it is the same, but here in Australia, I get a time that represents&amp;nbsp;&lt;SPAN&gt;2024-04-29 22:01:15.710 AEST, i.e. 10 hours later than the Zulu time.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you are just looking to remove the milliseconds and time zone indicator, then just reformat using&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval latest_time=strftime(strptime(latest_time, "%FT%T.%Q%Z"), "%F %T")&lt;/LI-CODE&gt;&lt;P&gt;Note that %F is shorthand for %Y-%m-%d and %T is a shortcut for %H:%M:%S&lt;/P&gt;&lt;P&gt;Note that that new time will be in your local time.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you don't care about time zones at all and simply want to remove the T, milliseconds and Z then you could just use sed, i.e.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex mode=sed field=latest_time "s/\.\d+Z// s/T/ /"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2024 00:18:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Zulu-time/m-p/685902#M114393</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2024-04-30T00:18:01Z</dc:date>
    </item>
    <item>
      <title>Re: Zulu time</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Zulu-time/m-p/685928#M114395</link>
      <description>&lt;P&gt;Hi, thanks for answering it's work perfectly with that&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| eval latest_time=strftime(strptime(latest_time, "%FT%T.%Q%Z"), "%F %T")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks again for your answer.&lt;/P&gt;
&lt;P&gt;Laurent&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2024 08:03:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Zulu-time/m-p/685928#M114395</guid>
      <dc:creator>Laurent</dc:creator>
      <dc:date>2024-04-30T08:03:39Z</dc:date>
    </item>
  </channel>
</rss>

