timestamps in floating point format

Posted on Feb 2, 2024 at 3:27 PM
Hi,
I tried and failed to parse the timestamps in log files where the format looks like this:

[1706782845.436764] [INFO ] [139899789445120] [Class.cpp@method:548] [Class] Running test class

The first part ([1706782845.436764]) represents a timestamp in seconds and fractions of seconds.
I was able to parse the seconds part and drop the rest, but failed to parse the full timestamp.

Best Regards,
Daniel
Posted on Feb 2, 2024 at 3:37 PM
Hi Daniel,

I am able to get a good parse using ElapsedDecimal with the pattern:
[%d{ElapsedDecimal}] [%p] [%S] [%S{Source}] [%c] %m%n 



ElapsedDecimal is actually recognized by the Parser Wizard, so you can just highlight the field and select the Mark as Date Time command.



Hope that helps,

Toby
Posted on Apr 5, 2024 at 9:58 AM
I just tried it, and it failed:

Posted on Apr 5, 2024 at 10:10 AM
Hi Daniel,

It is difficult to see where the problem could be here.  It looks like it may be parsing related rather than a problem with ElapsedDecimal. Can you please provide the sample log entry, or a sample timestamp?

Thanks,

Toby
Posted on Apr 5, 2024 at 10:16 AM
If I manually update the date in the sample above, it still parses fine with the pattern given:


Are you sure the log file format is the same?
Posted on Apr 5, 2024 at 10:40 AM
Here is a sample log entry I could not parse:

[1712130695.122167] [INFO ] [140305551292416] [SplineControllerLegacy.cpp@cycleCommand:373] [SplineControllerLegacy] New controller state: EXECUTING
Posted on Apr 5, 2024 at 10:45 AM
It seems to parse OK using the pattern above:





I think there might be an issue with the parser configuration you are using.
Posted on Apr 5, 2024 at 10:56 AM
I found the (probable) issue. I have a german locale set in my windows. This assumes the decimal separator being a comma.
If I replace the dot in the input with a comma, it works. But I have no control over the input format, so I cannot change this.
I found no settings in LogViewPlus that allows for specification of the decimal separator.

Posted on Apr 7, 2024 at 12:06 PM
I can confirm this is a bug.  We have implemented a fix which will be available as a BETA release later this week.  The fix address this issue as well as other aspects of the code which may have the same problem.

Thanks for bringing this issue to our attention!

Toby
Posted on Apr 8, 2024 at 6:23 AM
Good to know. I almost thought I was going crazy :-)
I am looking forward to the update!
Posted on Apr 30, 2024 at 1:04 PM
Hi Daniel,

I just wanted to let you know that we have now released LogViewPlus v3.1.9 as a BETA release.

This release addresses the ElapsedDecimal locale issue discussed above.

Thanks again for bringing this issue to our attention.  Please do let me know if you have any further questions or issues.

Toby
Posted on May 2, 2024 at 1:10 PM
Hi Toby,
thanks for the quick turnaround time on this issue.
I tried it and it seems to work fine now.
Thanks again,
Daniel
Posted on May 2, 2024 at 1:12 PM
Glad to hear it Daniel - thanks for letting me know!

Toby

This topic is closed and cannot receive new replies.