[Logwatch-Devel] Date arithmetic
Wed, 5 Nov 2003 07:13:59 -0700 (MST)
On Tue, 4 Nov 2003, Kenneth Porter wrote:
> I seem to recall a discussion a few months back about whether to start using
> Perl date-parsing modules to do better date recognition and arithmetic on log
> files. What's the current position on that?
> I'd like to see something like Date::Manip used so that "yesterday" really
> means the last 24 hours, no matter what time of day logwatch is run. This
> could also make it easier to parse files not written by syslog. (I'm thinking
> named, but I'm sure there are others, perhaps httpd.)
I would absolutely love it. I would love to have more date ranges. I
still think "yesterday" should mean what it does today, but there could
be a new date range 'last 24 hours' or something. And I would like a
variety of other date ranges... similar to the reports in Quicken if
anybody uses that.
But, that being said, I don't think it belongs in the very next stable
release because I want to get something out so that future patches will
be sent in based off of that and not off of the much older code.
The release after this one, though, would work great. I can't commit to
leading this development, but I may be able to. If somebody else wants
to lead it, I'll try to be as cooperative and helpful as I can.
My initial concern was whether Date::Manip was commonplace. It seems to
be installed on all Linux systems I use (perl-DateManip RPM), but I'm
sure not everybody has it.
Ideally, and I know this is possible but don't know how to do it off the
top of my head, we would use Date::Manip if available, but otherwise
fall back to the simple date support available today. If this makes the
code unnecesarilly nasty, then we could just require that Perl module.
Kirk Bauer <email@example.com>
http://linux.kaybee.org | www.autorpm.org | www.logwatch.org