<?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: Timestamp milliseconds not appearing in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Timestamp-milliseconds-not-appearing/m-p/303061#M57243</link>
    <description>&lt;P&gt;Ah right i get it now(think you had a typo in your command strp instead of strf for the stringTime. &lt;/P&gt;

&lt;P&gt;[sourcectypename]&lt;BR /&gt;
LINE_BREAKER = ([\r\n]+)&lt;BR /&gt;
TIME_FORMAT = as above&lt;BR /&gt;
TIME_PREFIX = ^&lt;BR /&gt;
MAX_TIMESTAMP_LOOKAHEAD = 27 ( i overset this this, initially it matched the actual length..thought it might be cutting it off)&lt;BR /&gt;
Truncate 999999&lt;BR /&gt;
SHOULD_LINEMERGE = false&lt;/P&gt;

&lt;P&gt;sample data:&lt;/P&gt;

&lt;P&gt;2017-07-11 08:54:12,815 31 [INFO] - - 5ms textHere MoreTEXT here[652].moretextHere(): MoreTextHere&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 14:49:44 GMT</pubDate>
    <dc:creator>mwdbhyat</dc:creator>
    <dc:date>2020-09-29T14:49:44Z</dc:date>
    <item>
      <title>Timestamp milliseconds not appearing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Timestamp-milliseconds-not-appearing/m-p/303054#M57236</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;

&lt;P&gt;I am extracting a timestamp in props.. everything is working fine except for the milliseconds at the end of it. &lt;/P&gt;

&lt;P&gt;Date format is 2017-07-11 08:54:12,815   -- my extraction is %Y-%m-%d %H-%M-%S,%3N &lt;/P&gt;

&lt;P&gt;That extraction works for similar data with a .(period) before the milliseconds instead of a comma - changing the end of the extract to .%3N - but it never works for a comma.&lt;/P&gt;

&lt;P&gt;Is there anything else needed when trying to extract milliseconds after a comma?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2017 08:06:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Timestamp-milliseconds-not-appearing/m-p/303054#M57236</guid>
      <dc:creator>mwdbhyat</dc:creator>
      <dc:date>2017-07-11T08:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp milliseconds not appearing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Timestamp-milliseconds-not-appearing/m-p/303055#M57237</link>
      <description>&lt;P&gt;Hi mwdbhyat,&lt;BR /&gt;
let me understand:&lt;BR /&gt;
you have another sourcetype with time format %Y-%m-%d %H-%M-%S.%3N that works with other data and  to read these data, do you want to use the same time format or to create another one?&lt;/P&gt;

&lt;P&gt;If you want to create another one it's easy because you insert the correct format in props.conf&lt;BR /&gt;
TIME_FORMAT = %Y-%m-%d %H-%M-%S,%3N&lt;/P&gt;

&lt;P&gt;If instead you want to use the same sourcetype, don't set any time format, Splunk recognize both the time format (I tried it).&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2017 08:22:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Timestamp-milliseconds-not-appearing/m-p/303055#M57237</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-07-11T08:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp milliseconds not appearing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Timestamp-milliseconds-not-appearing/m-p/303056#M57238</link>
      <description>&lt;P&gt;Hi Giuseppe,&lt;/P&gt;

&lt;P&gt;The issue im facing is that it will not extract the milliseconds from the timestamp when there is a comma in the timestamp before the milliseconds..&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2017 08:28:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Timestamp-milliseconds-not-appearing/m-p/303056#M57238</guid>
      <dc:creator>mwdbhyat</dc:creator>
      <dc:date>2017-07-11T08:28:54Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp milliseconds not appearing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Timestamp-milliseconds-not-appearing/m-p/303057#M57239</link>
      <description>&lt;P&gt;Hi mwdbhyat,&lt;BR /&gt;
if you set the time format (with dot or comma), it's correct that Splunk doesn't recognize both timestamps but only ther one that matches your settings.&lt;BR /&gt;
If instead you don't set the time format and leave that Splunk recognizes time format, it recognizes both the time formats.&lt;BR /&gt;
I created a file with your two time formats and Splunk recognized both of them.&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2017 08:39:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Timestamp-milliseconds-not-appearing/m-p/303057#M57239</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-07-11T08:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp milliseconds not appearing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Timestamp-milliseconds-not-appearing/m-p/303058#M57240</link>
      <description>&lt;P&gt;@cusello, slight correction to your answer, Hour Minute and Second are separated by colons(:) not hyphens (-).&lt;BR /&gt;
@mwdbhyat, please try out colon as separator for Time. I have added a run-anywhere search to test.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval epochTime=strptime("2017-07-11 08:54:12,815","%Y-%m-%d %H:%M:%S,%3N")
| eval stringTime=strptime(epochTime,"%Y-%m-%d %H:%M:%S,%3N")
| table epochTime stringTime
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Jul 2017 08:42:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Timestamp-milliseconds-not-appearing/m-p/303058#M57240</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-07-11T08:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp milliseconds not appearing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Timestamp-milliseconds-not-appearing/m-p/303059#M57241</link>
      <description>&lt;P&gt;Hi guys, &lt;/P&gt;

&lt;P&gt;Thanks for the help. @niketnilay - that was a typo in this question &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; ..I used colons not hyphens. the makeresults query only returns epochTime value? &lt;/P&gt;

&lt;P&gt;The issue at hand is this - %Y-%m-%d %H-%M-%S,%3N    should match 2017-07-11 08:54:12,815 but it doesnt take the milliseconds.. Thats the only problem..&lt;/P&gt;

&lt;P&gt;Not setting a TIME_FORMAT will be less performant so I dont want to leave it blank. &lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2017 09:15:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Timestamp-milliseconds-not-appearing/m-p/303059#M57241</guid>
      <dc:creator>mwdbhyat</dc:creator>
      <dc:date>2017-07-11T09:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp milliseconds not appearing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Timestamp-milliseconds-not-appearing/m-p/303060#M57242</link>
      <description>&lt;P&gt;makeresults is a generating command which allows you to create your own variable/data to be displayed.&lt;/P&gt;

&lt;P&gt;strptime() converts string time to epoch and strftime() converts from epoch to string. If you compare the two values (epochTime and stringTime) you will see that 815 is present in both hence milliseconds is working as expected.&lt;/P&gt;

&lt;P&gt;Is this extraction being done while &lt;STRONG&gt;sourcetype&lt;/STRONG&gt; definition in props.conf? Can you add your current settings and some sample raw data(mock or anonymize sensitive info where ever needed?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2017 09:33:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Timestamp-milliseconds-not-appearing/m-p/303060#M57242</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-07-11T09:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp milliseconds not appearing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Timestamp-milliseconds-not-appearing/m-p/303061#M57243</link>
      <description>&lt;P&gt;Ah right i get it now(think you had a typo in your command strp instead of strf for the stringTime. &lt;/P&gt;

&lt;P&gt;[sourcectypename]&lt;BR /&gt;
LINE_BREAKER = ([\r\n]+)&lt;BR /&gt;
TIME_FORMAT = as above&lt;BR /&gt;
TIME_PREFIX = ^&lt;BR /&gt;
MAX_TIMESTAMP_LOOKAHEAD = 27 ( i overset this this, initially it matched the actual length..thought it might be cutting it off)&lt;BR /&gt;
Truncate 999999&lt;BR /&gt;
SHOULD_LINEMERGE = false&lt;/P&gt;

&lt;P&gt;sample data:&lt;/P&gt;

&lt;P&gt;2017-07-11 08:54:12,815 31 [INFO] - - 5ms textHere MoreTEXT here[652].moretextHere(): MoreTextHere&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:49:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Timestamp-milliseconds-not-appearing/m-p/303061#M57243</guid>
      <dc:creator>mwdbhyat</dc:creator>
      <dc:date>2020-09-29T14:49:44Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp milliseconds not appearing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Timestamp-milliseconds-not-appearing/m-p/303062#M57244</link>
      <description>&lt;P&gt;This seems to work for me as well. Can you try createing a new sourcetype with only TIME_FORMAT and MAX_TIMESTAMP_LOOKAHEAD? Test with your data in preview mode whether it is working as expected or not.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[customSourcetypename]
DATETIME_CONFIG = 
MAX_TIMESTAMP_LOOKAHEAD = 24
NO_BINARY_CHECK = true
SHOULD_LINEMERGE = false
TIME_FORMAT = %Y-%m-%d %H:%M:%S,%3N
category = Custom
pulldown_type = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/208583-timestamp-with-millisecond.png" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:49:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Timestamp-milliseconds-not-appearing/m-p/303062#M57244</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-09-29T14:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp milliseconds not appearing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Timestamp-milliseconds-not-appearing/m-p/303063#M57245</link>
      <description>&lt;P&gt;Please take a look into: &lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/688698/why-are-milliseconds-not-being-parsed-in-cluster-e.html"&gt;https://answers.splunk.com/answers/688698/why-are-milliseconds-not-being-parsed-in-cluster-e.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Feb 2019 10:49:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Timestamp-milliseconds-not-appearing/m-p/303063#M57245</guid>
      <dc:creator>freedomson</dc:creator>
      <dc:date>2019-02-05T10:49:50Z</dc:date>
    </item>
  </channel>
</rss>

