<?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: Multiple timestap formats and subsecond with two digits only in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Multiple-timestap-formats-and-subsecond-with-two-digits-only/m-p/90137#M18697</link>
    <description>&lt;P&gt;Thanks dwaddle, I've tried the %2N to specify only two digits (or 9, on other CICS logs), but then I would have to stick with one format only and "lose" the second.&lt;/P&gt;</description>
    <pubDate>Wed, 17 Nov 2010 17:33:19 GMT</pubDate>
    <dc:creator>Paolo_Prigione</dc:creator>
    <dc:date>2010-11-17T17:33:19Z</dc:date>
    <item>
      <title>Multiple timestap formats and subsecond with two digits only</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Multiple-timestap-formats-and-subsecond-with-two-digits-only/m-p/90134#M18694</link>
      <description>&lt;P&gt;Hi everybody, is it possible to teach a custom datetime.xml that my subsecond field is only two digit long? &lt;/P&gt;

&lt;P&gt;I have a log file with two different timestamp formats, one of which is not automatically recognized. Here's an example:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
  &lt;P&gt;00000000000000000001289525909952;2010-11-12 02:38:32:47;P2LIV ....&lt;/P&gt;
  
  &lt;P&gt;00000000000000000001289525916501;2010111202383591;YT00B ....&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;so I had to configure a custom datetime.xml which is working fine, except I am not able to let it extract the subseconds: Splunk always interprets them as zero.&lt;BR /&gt;
Here's my custom datetime.xml:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;datetime&amp;gt;
&amp;lt;define name="_combdatetime_consMSG1" extract="year, month, day, hour, minute, second, subsecond"&amp;gt;
    &amp;lt;!-- ...  2010-11-12 02:38:36:90 ...' --&amp;gt;
    &amp;lt;text&amp;gt;&amp;lt;![CDATA[(\d+)-(\d+)-(\d+)\s(\d+):(\d+):(\d+):(\d+)]]&amp;gt;&amp;lt;/text&amp;gt;
&amp;lt;/define&amp;gt;
&amp;lt;define name="_combdatetime_consMSG2" extract="year, month, day, hour, minute, second, subsecond"&amp;gt;
    &amp;lt;!-- ...  2010111202383691 ...' --&amp;gt;
    &amp;lt;text&amp;gt;&amp;lt;![CDATA[(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})]]&amp;gt;&amp;lt;/text&amp;gt;
&amp;lt;/define&amp;gt;
&amp;lt;timePatterns&amp;gt;
      &amp;lt;use name="_combdatetime_consMSG1"/&amp;gt;
      &amp;lt;use name="_combdatetime_consMSG2"/&amp;gt;
&amp;lt;/timePatterns&amp;gt;
&amp;lt;datePatterns&amp;gt;
      &amp;lt;use name="_combdatetime_consMSG1"/&amp;gt;
      &amp;lt;use name="_combdatetime_consMSG2"/&amp;gt;
&amp;lt;/datePatterns&amp;gt;
&amp;lt;/datetime&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And this is how Splunk web displays those two timestamps&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
  &lt;P&gt;11/12/10 2:38:32.000 AM&lt;/P&gt;
  
  &lt;P&gt;11/12/10 2:38:35.000 AM&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;I've tried to manually modify the source file to put a trailing 0 after the timestamp (to bring it to a millis format) and changed the regexes accordingly, but had no luck (after a full restart, too) 
Anybody has an idea? &lt;/P&gt;

&lt;P&gt;Thanks, Paolo&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2010 23:42:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Multiple-timestap-formats-and-subsecond-with-two-digits-only/m-p/90134#M18694</guid>
      <dc:creator>Paolo_Prigione</dc:creator>
      <dc:date>2010-11-16T23:42:50Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple timestap formats and subsecond with two digits only</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Multiple-timestap-formats-and-subsecond-with-two-digits-only/m-p/90135#M18695</link>
      <description>&lt;P&gt;As a sidenote: MAX_TIMESTAMP_LOOKAHEAD is set high enough for Splunk to read the whole timestamp.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:20:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Multiple-timestap-formats-and-subsecond-with-two-digits-only/m-p/90135#M18695</guid>
      <dc:creator>Paolo_Prigione</dc:creator>
      <dc:date>2020-09-28T09:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple timestap formats and subsecond with two digits only</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Multiple-timestap-formats-and-subsecond-with-two-digits-only/m-p/90136#M18696</link>
      <description>&lt;P&gt;Hi Paolo,&lt;/P&gt;

&lt;P&gt;You may be better off using TIME_FORMAT in props.conf rather than changing datetime.xml.  Its handling of subseconds and subsecond precision is covered on another answers post:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://answers.splunk.com/questions/1946/time-format-and-subseconds" rel="nofollow"&gt;http://answers.splunk.com/questions/1946/time-format-and-subseconds&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2010 10:31:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Multiple-timestap-formats-and-subsecond-with-two-digits-only/m-p/90136#M18696</guid>
      <dc:creator>dwaddle</dc:creator>
      <dc:date>2010-11-17T10:31:17Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple timestap formats and subsecond with two digits only</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Multiple-timestap-formats-and-subsecond-with-two-digits-only/m-p/90137#M18697</link>
      <description>&lt;P&gt;Thanks dwaddle, I've tried the %2N to specify only two digits (or 9, on other CICS logs), but then I would have to stick with one format only and "lose" the second.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2010 17:33:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Multiple-timestap-formats-and-subsecond-with-two-digits-only/m-p/90137#M18697</guid>
      <dc:creator>Paolo_Prigione</dc:creator>
      <dc:date>2010-11-17T17:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple timestap formats and subsecond with two digits only</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Multiple-timestap-formats-and-subsecond-with-two-digits-only/m-p/90138#M18698</link>
      <description>&lt;P&gt;D'oh!  I completely missed that aspect of what you were explaining.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2010 00:11:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Multiple-timestap-formats-and-subsecond-with-two-digits-only/m-p/90138#M18698</guid>
      <dc:creator>dwaddle</dc:creator>
      <dc:date>2010-11-18T00:11:16Z</dc:date>
    </item>
  </channel>
</rss>

