How to parse a time with a timestamp in seconds instead of a formatted date time?


How to parse a time with a timestamp in seconds instead of a formatted...
Author
Message
LogViewPlus Support
LogViewPlus Support
Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)
Group: Moderators
Posts: 1.3K, Visits: 4.6K
Hi Chris,

We have now released LogViewPlus 3.2.7 as a BETA Release.  This release address the template issue you highlighted above.

Thanks again for bringing this to our attention.

Toby
LogViewPlus Support
LogViewPlus Support
Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)
Group: Moderators
Posts: 1.3K, Visits: 4.6K
Thanks for bringing this to my attention Chris.

I can confirm this is a bug in the BETA release only.  I have implemented a fix which we can hopefully put into BETA tomorrow.

In the meantime, I would suggest using the templates from the ribbon menu.

Thanks again!

Toby
ChrisAbbott
ChrisAbbott
New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)
Group: Forum Members
Posts: 5, Visits: 7
Well trying the BETA I did notice that there is a popup menu missing:
 "Right Click" -> "Apply Template" -> nothing

LogViewPlus Support
LogViewPlus Support
Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)
Group: Moderators
Posts: 1.3K, Visits: 4.6K
Thanks Chris.

If you have any further issues, please do let me know.
ChrisAbbott
ChrisAbbott
New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)
Group: Forum Members
Posts: 5, Visits: 7
Thanks, I'll give the BETA a g
LogViewPlus Support
LogViewPlus Support
Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)
Group: Moderators
Posts: 1.3K, Visits: 4.6K
Hi Chris,

Glad you were able to find a parsing configuration that works for you.

The file name pattern on the Parser Wizard is fixed when you are editing an existing parser.  The way to work around this is to edit the parser configuration direction (without using the Wizard).



We have made significant changes to how we import and export application settings in the lastest BETA release and I would suggest using BETA version with your team.  The new release allows an individual parser configuration to be exported and imported.  The previous releases did not support merging settings, so import / export was not very useful for sharing an individual parser configuration.

Hope that helps,

Toby
ChrisAbbott
ChrisAbbott
New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)
Group: Forum Members
Posts: 5, Visits: 7
I now have other questions:
A) When I open "Parser Configuration Wizard" there is a "File Name Pattern:" but this is not correct, how do I change this; currently shown in gray and un-editable; shows "can*_log_powerOn_du_br_dhu.trc" and I need it to be "can*.trc"
B) How do I save this "Parser Configuration" so it can be shared within the team
ChrisAbbott
ChrisAbbott
New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)
Group: Forum Members
Posts: 5, Visits: 7
Not sure why, but when I tried your patterns they did not work, however they included the answer I wanted on the date format, so I came up with the following regular expression, which is working:
^\s*(?<msgnum>\d+)\)\s+(?<d{ElapsedTimeSeconds}>\d+\.\d+)\s+(?<type>\w+)\s+(?<COBid>[0-9A-F]+)\s+(?<len>\d+)\s+(?<data>.[^\r\n]*)


Edited 7 days ago @ 12:36 PM by ChrisAbbott
LogViewPlus Support
LogViewPlus Support
Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)Supreme Being (12K reputation)
Group: Moderators
Posts: 1.3K, Visits: 4.6K
Hi Chris,

Apologies for the delay in getting back to you. 

I am able to get a good parse on this file using the Pattern Parser with ...
%4S{RowId})  %d{ElapsedTimeSeconds} %-4s{Type} %m%n



I am using Format Modifiers here to specify expected field lengths. 

I had to use two spaces infront of the date and I am not sure why.  There may be an issue here and I will investigate that.  In the meantime, I would recommend the multi-pattern:
%4S{RowId})  %d{ElapsedTimeSeconds} %-4s{Type} %m%n
%4S{RowId}) %d{ElapsedTimeSeconds} %-4s{Type} %m%n

This allows the log entry to be parsed if one or two spaces are found.

Hope that helps,

Toby

Edited Last Month by LogViewPlus Support
ChrisAbbott
ChrisAbbott
New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)
Group: Forum Members
Posts: 5, Visits: 7
Hi, I want to parse files with lines as in attached file, I can do this with redis rules, but cannot get the "mandatory date" to work:
^\s*(?<msgnum>\d+)\)\s+(?<time>\d+\.\d+)\s+(?<type>\w+)\s+(?<COBid>[0-9A-F]+)\s+(?<len>\d+)\s+(?<data>.*)

<time> needs to be <d> but with something else so it can 12738.2 into 12738.2 seconds

The "un-altered" file also contains "comment" lines that start with ";" and do not follow the format, but I have no idea how to get the parser to ignore these.

Also: With the pattern parser I could not find anyway to indicate 1 or more white spaces between elements

File content:
34)  12947.7 Rx   0710 1 05
  35)  12966.3 Rx   072B 1 7F
  36)  13042.5 Rx   0000 2 01 2B
  37)  13043.2 Rx   03AB 1 00
  38)  13066.3 Rx   072B 1 05
  39)  13140.9 Rx   073C 1 7F
  40)  13167.4 Rx   063C 8 23 E0 20 01 EA 39 98 CA
  41)  13168.0 Rx   05BC 8 60 E0 20 01 00 00 00 00
  42)  13169.1 Rx   062B 8 23 C9 20 00 27 39 F0 4C
  43)  13169.8 Rx   05AB 8 60 C9 20 00 00 00 00 00
  44)  13241.7 Rx   072D 1 7F
  45)  13468.6 Rx   0000 2 01 2B
  46)  13468.8 Rx   0000 2 82 10
  47)  13468.9 Rx   0000 2 01 10
  48)  13469.1 Rx   0000 2 82 11
  49)  13469.2 Rx   0000 2 01 11
  50)  13469.3 Rx   0000 2 81 30
  51)  13469.4 Rx   0710 1 04
  52)  13469.9 Rx   0711 1 04

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Login

Explore
Messages
Mentions
Search