Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logbert columnizer not reading the date and coming up all zeros? #15

Closed
leeand00 opened this issue Dec 6, 2019 · 5 comments
Closed

Comments

@leeand00
Copy link

leeand00 commented Dec 6, 2019

When I read the custom columnizer as a timestamp, how many matches do I need in my RegEx for that to display?

I used the button to specify the date format and that seemed to work, but the columnizer still reads it all as 00/00/00 00:00:00.00.000

@leeand00
Copy link
Author

leeand00 commented Dec 6, 2019

Here is the regex I am using for that: ^([0-1][0-9])/([0-3][0-9])/([0-9][0-9]) ([0-9][0-9]):([0-5][0-9]):([0-5][0-9]).([0-9][0-9][0-9])

@couchcoding
Copy link
Owner

Do you have an example log file (or a few lines of log) for me?

@leeand00
Copy link
Author

leeand00 commented Dec 6, 2019

Well here's one:

12/05/19 08:27:49.938, 0, 0,LoadHandlers,        3,Effectivity job ran in 17.015 ms for COMBO_GROUP_DETAIL_PRICE,

They all begin with that prefix.

Strangely, some of these also have additionally lines after a log entry (another words, instead of just a single log line, they will be a line similar to what I posted above) followed by a line break CRLF and and then it'll just do a free for all for instance:

12/05/19 08:27:49.938, 0, 0,LoadHandlers,        3,12-05 08:27:49

Job                    Process MS  Upd db MS  Get ChgSets MS  Total #  Updated #  Sql Run
---------------------  ----------  ---------  --------------  -------  ---------  -------
MiPrice                         0          0               0        0          0        0
Tax                             0          0               0        0          0        0
Discount                        0          0               0        0          0        0
PageCA                          0          0               0        0          0        0
TenderMedia                     0          0               0        0          0        0
ServiceCharge                   0          0               0        0          0        0
ComboGroupDetailPrice          15          0               0        0          0        0

TOTALS                         15          0               0        0          0        0

Total ms: 15

,
12/05/19 08:27:47.310, 0, 0,LoadHandlers,        5,OPS Requesting database updates,

Not sure if that could be screwing it up.

@couchcoding
Copy link
Owner

Based on your example log entries, i created a working columnizer.

2019-12-10_06-37-12

Paste the following XML fragment into the columnizer.xml file and rename "issue_15" into something more meaningful:

<Columnizer Name="Issue_15" DateTimeFormat="MM-dd-yy hh:mm:ss.fff">
  <LogColumns>
    <LogColumn Name="Timestamp" Expression="^([0-1][0-9]/[0-3][0-9]/[0-9][0-9] [0-9][0-9]:[0-5][0-9]:[0-5][0-9].[0-9][0-9][0-9]),.*" Optional="False" Type="1" />
    <LogColumn Name="Unknown 1" Expression="^[0-1][0-9]/[0-3][0-9]/[0-9][0-9] [0-9][0-9]:[0-5][0-9]:[0-5][0-9].[0-9][0-9][0-9],[\s]*([0-9])[\s]*,.*" Optional="False" Type="0" />
    <LogColumn Name="Unknown 2" Expression="^[0-1][0-9]/[0-3][0-9]/[0-9][0-9] [0-9][0-9]:[0-5][0-9]:[0-5][0-9].[0-9][0-9][0-9],[\s]*[0-9][\s]*,[\s]*([0-9])[\s]*,.*" Optional="False" Type="0" />
    <LogColumn Name="Sender" Expression="^[0-1][0-9]/[0-3][0-9]/[0-9][0-9] [0-9][0-9]:[0-5][0-9]:[0-5][0-9].[0-9][0-9][0-9],[\s]*[0-9][\s]*,[\s]*[0-9][\s]*,([0-9A-Za-z]+),.*" Optional="False" Type="0" />
    <LogColumn Name="Level" Expression="^[0-1][0-9]/[0-3][0-9]/[0-9][0-9] [0-9][0-9]:[0-5][0-9]:[0-5][0-9].[0-9][0-9][0-9],[\s]*[0-9][\s]*,[\s]*[0-9][\s]*,[0-9A-Za-z]+,[\s]*([0-9])[\s]*,.*" Optional="False" Type="2" />
    <LogColumn Name="Message" Expression="^[0-1][0-9]/[0-3][0-9]/[0-9][0-9] [0-9][0-9]:[0-5][0-9]:[0-5][0-9].[0-9][0-9][0-9],[\s]*[0-9][\s]*,[\s]*[0-9][\s]*,[0-9A-Za-z]+,[\s]*[0-9][\s]*,((.|\n)*),.*" Optional="False" Type="3" />
  </LogColumns>
  <LogLevels>
    <LogLevel Value="0" Level="1" />
    <LogLevel Value="1" Level="2" />
    <LogLevel Value="2" Level="4" />
    <LogLevel Value="3" Level="8" />
    <LogLevel Value="4" Level="16" />
    <LogLevel Value="5" Level="32" />
  </LogLevels>
</Columnizer>

@leeand00
Copy link
Author

leeand00 commented Dec 10, 2019

Thank you! I was not aware that LogBert could match like that using \n I will take a look into this and let you know what happens. Good to know also that the Columnizers are configurable in XML as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants