<?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 timestamp extraction for time format with leading zero omitted in the event in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/timestamp-extraction-for-time-format-with-leading-zero-omitted/m-p/69366#M14050</link>
    <description>&lt;P&gt;Hi,
I would like to extract timestamp from events where the leading zeros of the time format are omitted.
Most of the events have the time format like the example below, where Splunk is able to extract the correct time for the events to be 2010/03/22 11:59:49 pm.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;20100322,235949,1=1,52=M2010032223594908434,11=192.168.99.132,2=20
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However the leading zeros in the time format are omitted.  For exmaple "20100322,314,..." means 2010/03/22 00:03:14 am.&lt;/P&gt;

&lt;P&gt;Splunk extracts incorrectly for the following event sample to 2010/03/22 10:05:08 pm. The correct time for the event below should be 2010/03/22 02:20:58 am:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;20100322,22058,1=1,110=250 U2M2Kv0225593 Message accepted
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;At the extreme end, events with 5 omitted leading zeros in the time format like 20100322,1,1=1,...., and it's timestamp should be 2010/03/22 00:00:01 am.&lt;/P&gt;

&lt;P&gt;What's best way to extract such time format from the events? If it involves modifying the datetime.xml, please kindly provide the REGEX.&lt;/P&gt;

&lt;P&gt;Thanks. &lt;/P&gt;</description>
    <pubDate>Wed, 13 Oct 2010 11:50:50 GMT</pubDate>
    <dc:creator>alextsui</dc:creator>
    <dc:date>2010-10-13T11:50:50Z</dc:date>
    <item>
      <title>timestamp extraction for time format with leading zero omitted in the event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/timestamp-extraction-for-time-format-with-leading-zero-omitted/m-p/69366#M14050</link>
      <description>&lt;P&gt;Hi,
I would like to extract timestamp from events where the leading zeros of the time format are omitted.
Most of the events have the time format like the example below, where Splunk is able to extract the correct time for the events to be 2010/03/22 11:59:49 pm.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;20100322,235949,1=1,52=M2010032223594908434,11=192.168.99.132,2=20
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However the leading zeros in the time format are omitted.  For exmaple "20100322,314,..." means 2010/03/22 00:03:14 am.&lt;/P&gt;

&lt;P&gt;Splunk extracts incorrectly for the following event sample to 2010/03/22 10:05:08 pm. The correct time for the event below should be 2010/03/22 02:20:58 am:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;20100322,22058,1=1,110=250 U2M2Kv0225593 Message accepted
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;At the extreme end, events with 5 omitted leading zeros in the time format like 20100322,1,1=1,...., and it's timestamp should be 2010/03/22 00:00:01 am.&lt;/P&gt;

&lt;P&gt;What's best way to extract such time format from the events? If it involves modifying the datetime.xml, please kindly provide the REGEX.&lt;/P&gt;

&lt;P&gt;Thanks. &lt;/P&gt;</description>
      <pubDate>Wed, 13 Oct 2010 11:50:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/timestamp-extraction-for-time-format-with-leading-zero-omitted/m-p/69366#M14050</guid>
      <dc:creator>alextsui</dc:creator>
      <dc:date>2010-10-13T11:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: timestamp extraction for time format with leading zero omitted in the event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/timestamp-extraction-for-time-format-with-leading-zero-omitted/m-p/69367#M14051</link>
      <description>&lt;P&gt;I'm not sure this is possible.  Parsing is difficult when there is ambiguity - would a time of "1111" be 00:11:11, 11:11:00 or 01:01:01?  &lt;/P&gt;

&lt;P&gt;In my opinion, this is the type of problem where for the sake of your own sanity you are far better off to try to get the source application fixed to where it either delimits Hour, Minute, Second, Subsecond or 0-fills appropriately.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Oct 2010 09:48:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/timestamp-extraction-for-time-format-with-leading-zero-omitted/m-p/69367#M14051</guid>
      <dc:creator>dwaddle</dc:creator>
      <dc:date>2010-10-21T09:48:44Z</dc:date>
    </item>
  </channel>
</rss>

