<?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: How to parse out milliseconds from timestamp in log file? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-out-milliseconds-from-timestamp-in-log-file/m-p/186948#M37405</link>
    <description>&lt;P&gt;At least now Splunk is looking in the right place for the timestamp.  Did you insert the asterisks or are they part of the data?&lt;/P&gt;

&lt;P&gt;Tell us more about your data.  What does it represent?  Milliseconds since when?&lt;/P&gt;</description>
    <pubDate>Tue, 28 Oct 2014 12:20:30 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2014-10-28T12:20:30Z</dc:date>
    <item>
      <title>How to parse out milliseconds from timestamp in log file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-out-milliseconds-from-timestamp-in-log-file/m-p/186945#M37402</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;BREAK_ONLY_BEFORE=\d{7}
NO_BINARY_CHECK=1
SHOULD_LINEMERGE=true
TIME_FORMAT=%3N
TIME_PREFIX=\d{7}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Trying to parse out the millisecond timestamp from this log file, &lt;CODE&gt;9281736&lt;/CODE&gt; :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  9281736 : COUNT IN 1003
Tx:   01 04 00 71 00 02 21 d0                              ...q..!.
Rx:   01 04 04 00 08 0a 28 7c f8    
  9282136 : COUNT IN 1003
Tx:   01 04 00 c9 00 02 a1 f5                              ........
Rx:   01 04 04 00 08 00 00 7a 46 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I suspect my TIME_FORMAT is wrong, because it breaks up events correctly with regex \d{7}.&lt;BR /&gt;
But according to the error message it doesn't look for the timestamp in the correct spot. Or is it? &lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;Could not use strptime to parse timestamp from ": COUNT 1003\n ...... &lt;BR /&gt;
Make sure a prefix pattern is&lt;BR /&gt;
specified if the events don`t begin&lt;BR /&gt;
with a timestamp.&lt;/P&gt;

&lt;P&gt;Failed to parse timestamp. Defaulting to file modtime.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Any suggestion would be much appreciated!&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2014 11:04:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-out-milliseconds-from-timestamp-in-log-file/m-p/186945#M37402</guid>
      <dc:creator>nitrogaute</dc:creator>
      <dc:date>2014-10-28T11:04:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse out milliseconds from timestamp in log file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-out-milliseconds-from-timestamp-in-log-file/m-p/186946#M37403</link>
      <description>&lt;P&gt;Remove the &lt;CODE&gt;TIME_PREFIX&lt;/CODE&gt; statement.  That tells Splunk to start looking for a timestamp &lt;EM&gt;after&lt;/EM&gt; finding 7 digits.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2014 11:47:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-out-milliseconds-from-timestamp-in-log-file/m-p/186946#M37403</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2014-10-28T11:47:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse out milliseconds from timestamp in log file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-out-milliseconds-from-timestamp-in-log-file/m-p/186947#M37404</link>
      <description>&lt;P&gt;That makes the timestamp appear in the in the error message. No changes appart from that in Data preview.&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;Could not use strptime to parse&lt;BR /&gt;
timestamp from "&lt;STRONG&gt;&lt;EM&gt;9281736&lt;/EM&gt;&lt;/STRONG&gt; : COUNT 1003n&lt;BR /&gt;
...... Make sure a prefix pattern is&lt;BR /&gt;
specified if the events don`t begin&lt;BR /&gt;
with a timestamp. Failed to parse&lt;BR /&gt;
timestamp. Defaulting to file modtime.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 28 Oct 2014 11:52:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-out-milliseconds-from-timestamp-in-log-file/m-p/186947#M37404</guid>
      <dc:creator>nitrogaute</dc:creator>
      <dc:date>2014-10-28T11:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse out milliseconds from timestamp in log file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-out-milliseconds-from-timestamp-in-log-file/m-p/186948#M37405</link>
      <description>&lt;P&gt;At least now Splunk is looking in the right place for the timestamp.  Did you insert the asterisks or are they part of the data?&lt;/P&gt;

&lt;P&gt;Tell us more about your data.  What does it represent?  Milliseconds since when?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2014 12:20:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-out-milliseconds-from-timestamp-in-log-file/m-p/186948#M37405</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2014-10-28T12:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse out milliseconds from timestamp in log file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-out-milliseconds-from-timestamp-in-log-file/m-p/186949#M37406</link>
      <description>&lt;P&gt;No, the asterisks is not part of the data. See the logfile entries in the above.&lt;/P&gt;

&lt;P&gt;The logfile represent modbus communications between a master and a slave. The milliseconds is since last restart of the master node. I want to trend out timeout periods of the communications and look at what happens just before a period of timeout/no RX.&lt;/P&gt;

&lt;P&gt;I`m also interested in other ways to do this. The logfiles are aprox 250 mb&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2014 12:28:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-out-milliseconds-from-timestamp-in-log-file/m-p/186949#M37406</guid>
      <dc:creator>nitrogaute</dc:creator>
      <dc:date>2014-10-28T12:28:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse out milliseconds from timestamp in log file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-out-milliseconds-from-timestamp-in-log-file/m-p/186950#M37407</link>
      <description>&lt;P&gt;Without a fixed reference point, I don't see how Splunk can convert your milliseconds into timestamps.  Perhaps someone else will have a suggestion.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2014 12:35:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-out-milliseconds-from-timestamp-in-log-file/m-p/186950#M37407</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2014-10-28T12:35:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse out milliseconds from timestamp in log file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-out-milliseconds-from-timestamp-in-log-file/m-p/186951#M37408</link>
      <description>&lt;P&gt;It knows the first entry. Should`t that be OK?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2014 12:38:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-out-milliseconds-from-timestamp-in-log-file/m-p/186951#M37408</guid>
      <dc:creator>nitrogaute</dc:creator>
      <dc:date>2014-10-28T12:38:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse out milliseconds from timestamp in log file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-out-milliseconds-from-timestamp-in-log-file/m-p/186952#M37409</link>
      <description>&lt;P&gt;Each event is processed independently and is unaware of what was processed previously.&lt;BR /&gt;
Maybe you could write a script to process your log files and convert the milliseconds into timestamps that Splunk can process.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2014 12:46:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-out-milliseconds-from-timestamp-in-log-file/m-p/186952#M37409</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2014-10-28T12:46:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse out milliseconds from timestamp in log file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-out-milliseconds-from-timestamp-in-log-file/m-p/186953#M37410</link>
      <description>&lt;P&gt;I could convert milliseconds to hours, minuttes and seconds.. But would that make any difference? Or do I need the date also to give Splunk sufficient reference?&lt;/P&gt;

&lt;P&gt;I would assume Splunk sets the reference point at 0 in a 7 digit milisecond timestamp..&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2014 12:52:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-out-milliseconds-from-timestamp-in-log-file/m-p/186953#M37410</guid>
      <dc:creator>nitrogaute</dc:creator>
      <dc:date>2014-10-28T12:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse out milliseconds from timestamp in log file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-out-milliseconds-from-timestamp-in-log-file/m-p/186954#M37411</link>
      <description>&lt;P&gt;Given only a time, Splunk will use the current date.&lt;/P&gt;

&lt;P&gt;Assuming you could get Splunk to understand a 7 digit millisecond timestamp (I failed to do so), it would likely use zero as its reference point and you would end up with a timestamp in early 1970.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2014 12:57:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-out-milliseconds-from-timestamp-in-log-file/m-p/186954#M37411</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2014-10-28T12:57:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse out milliseconds from timestamp in log file?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-out-milliseconds-from-timestamp-in-log-file/m-p/186955#M37412</link>
      <description>&lt;P&gt;Hmm, I see you&lt;CODE&gt;re point. But I still think it&lt;/CODE&gt;s strange that Splunk does not handle relative time...&lt;/P&gt;</description>
      <pubDate>Tue, 28 Oct 2014 13:00:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-parse-out-milliseconds-from-timestamp-in-log-file/m-p/186955#M37412</guid>
      <dc:creator>nitrogaute</dc:creator>
      <dc:date>2014-10-28T13:00:59Z</dc:date>
    </item>
  </channel>
</rss>

