approach on parsing the query-log file
Gregory Hicks
ghicks at hicks-net.net
Tue Apr 28 15:31:20 UTC 2009
> From: Jonathan Petersson <jpetersson at garnser.se>
> Date: Tue, 28 Apr 2009 08:13:25 -0700
> Subject: Re: approach on parsing the query-log file
> To: Niall.oReilly at ucd.ie
> Cc: Bind Mailing <bind-users at lists.isc.org>
>
> Yeah I've thought about using tail but I'm not sure how locking would
> be managed when logrotate kicks in, does anyone know?
I use "tail -f <log-file>"
When the log rotates, the tail is still running against the rotated
file. I have to manually change to the current file. ("^C-!!" works)
A better way to do it might be to have the 'logfile' be a pipe and have
the parsing intelligence on the other side of the pipe. Have the log
rotation "smarts" be on the other side of the pipe also. (At one $JOB,
I used this technique to separate out different log messages from
simultaneously running SMTP processes.)
Regards,
GRegory Hicks
>
> On Tue, Apr 28, 2009 at 3:41 AM, Niall O'Reilly <Niall.oReilly at ucd.ie>
wrote:
> > On Mon, 2009-04-27 at 22:26 -0700, Jonathan Petersson wrote:
> >> The obvious question that occurs is; What would be what's the best
> >> approach to do this?
> >
> > I've not used it, but a colleague is very keen on File::Tail
> > (http://search.cpan.org/~mgrabnar/File-Tail-0.99.3/Tail.pm).
> > Apparently, it looks after log-file roll-over and 'just
works'.
> >
> > /Niall
> >
> >
> >
> _______________________________________________
> bind-users mailing list
> bind-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/bind-users
>
---------------------------------------------------------------------
Gregory Hicks | Principal Systems Engineer
| Direct: 408.569.7928
People sleep peaceably in their beds at night only because rough men
stand ready to do violence on their behalf -- George Orwell
The price of freedom is eternal vigilance. -- Thomas Jefferson
"The best we can hope for concerning the people at large is that they
be properly armed." --Alexander Hamilton
More information about the bind-users
mailing list