mcross1882 / LogAnalyzer

Log analyzer and summary builder written in Scala built for JVM projects
Apache License 2.0
0 stars 1 forks source link

Improve timestamp analyzer #8

Open mcross1882 opened 10 years ago

mcross1882 commented 10 years ago

Right now there is a special analyzer category called timestamp if you create a analyzer of that category the application will use the corresponding regex value to extract a date from the log line. This is then used to filter out records that are not within the specified date range. With all this said there's some major improvements that need to be made...

1 - Connect the Joda Time library with the timestamp analyzer. This would give us a few benefits first instead of having to write raw regex we can use the Joda Time date formats which are much more user friendly.

2 - Support multiple timestamps. Right now we store the timestamps as a list but only the head -- first -- value is used. Instead we should iterate through each timestamp until the first success and use that format.

Expectation

<analyzer category="timestamp" regex="[yyy-MM-dd hh:mm:ss]" vars="timestamp">
    $timestamp
</analyzer>