Problem getting absolute date from log

Notes, tips, and other usefull things on how to use LogMX

Moderator: admin

Post Reply
evilpaul
Posts: 2
Joined: Fri Feb 27, 2015 5:03 pm

Problem getting absolute date from log

Post by evilpaul »

Hi..

I'm trying to get logs from my app working in LogMX. I'm almost there, but I can't get the absolute date to work which means that I can't filter by date.

My logs are pretty simple - just an ISO 8601 timestamp and a message. They looks like this:

Code: Select all

2015-02-27T15:46:44.619Z: Timer : returning to normal mode
2015-02-27T15:46:44.619Z: slave manager role : Solo
2015-02-27T15:46:44.620Z: slave manager role : Solo
2015-02-27T15:46:44.621Z: Timer : returning to normal mode
2015-02-27T15:46:44.634Z:  -- detected eyefinity 16:10 x 1
2015-02-27T15:46:44.644Z: !!! Failed to access file size for 'tahoma_10.5.font': The system cannot find the file specified.
2015-02-27T15:46:44.655Z: !!! Failed to access file size for 'arial_15.font': The system cannot find the file specified.
2015-02-27T15:46:44.661Z:   starting HelpSystem ...
I'm using a regex parser that looks like:

Code: Select all

(.*Z): (.*)
..which translates to "Timestamp" and "Message". Timestamp format is:

Code: Select all

YYYY-MM-dd'T'HH:mm:ss.SSSX
This works pretty much as expected - the parser finds the message and the relative date perfectly, but the absolute date doesn't come across. If I try right-dragging a group of events on the timeline I get:
Unable to use date filter since this file format (parsername (using Regular Expression "(.Z)*: (.*)")) doesn't handle absolute timestamps.
Any clues as to what I'm doing wrong here?
admin
Site Admin
Posts: 555
Joined: Sun Dec 17, 2006 10:30 pm

Re: Problem getting absolute date from log

Post by admin »

Hello,

You simply used "YYYY" to mean "year", instead of "yyyy".
So the right date format to use is:

Code: Select all

yyyy-MM-dd'T'HH:mm:ss.SSSX
Please note that you shall use Java 7 (or more) to use the "X" character for ISO8601 timezones.

See http://docs.oracle.com/javase/7/docs/ap ... ormat.html for more information on date formats.

Xavier
evilpaul
Posts: 2
Joined: Fri Feb 27, 2015 5:03 pm

Re: Problem getting absolute date from log

Post by evilpaul »

Ah.. got it. Thank you :)
Post Reply