date parser for bind log dates

Kevin Darcy kcd at daimlerchrysler.com
Wed Mar 16 23:19:02 UTC 2005


Seems to work for me:

% cat /tmp/testparse.pl
#!/usr/bin/perl

use Date::Parse;

$foo = "16-Mar-2005 18:16:20.330";

$bar = localtime(str2time($foo));
print "$bar\n";
% /tmp/testparse.pl
Wed Mar 16 18:16:20 2005
%

I'm using the 2.27 version of Date::Parse here...

- Kevin


Lindy Foster wrote:

>I'm looking for something that will parse the style of dates used
>in bind logging. They are:
>
>dd-Mon-yyyy hh:mm:ss.sss
>
>Date::Parse doesn't appear to handle this. I could write it,
>but if it already exists....
>
>I want to use this with LogWatch, so if anyone has dnssec logwatch
>filters, I'd be interested in those too. I have some written, so if anyone
>is interested, I'll let you know when I'm done with the date stuff.
>
>thanks,
>
>lindy foster
>lindy at tislabs.com
>
>
>
>
>
>
>  
>




More information about the bind-users mailing list