>>     3. There doesn't seem to be a way to process live varnishncsa data
>> via a pipe. If this were possible, then I think I would find this whole
>> process a lot easier. Instead, it seems there are two options: to
>> historically dump log data via an option, or run as a daemon and send
>> output to a file (which cannot be via a pipe).
> Wrong.  Both varnishlog and varnishncsa will, by default, process live
> data and print it to stdout, where you can pipe it to whatever you like.


You can post-process varnishncsa data to any post-processing program you want.

Or, for example, using Perl ..you may launch the program and take the
output directly to the files you want.


open (COMMAND, "varnishncsa | ") or die "Could not open varnishncsa...\n";

while (<COMMAND>) {

# bla bla bla
print $_; # Print actual line


close COMMAND;

Every request is logged with full DN in the URL. - - [29/Jan/2009:16:56:16 +0100] "GET
http://www.FULLDOMAIN.info/static HTTP/1.0" 503 466 "referer"
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR

So it's not difficult to make a program to separate logs depending on
your needs.

Btw, a program in C made by varnish programmers to accomplish this may
be greatly appreciated by the community ;-)

varnish-misc mailing list

Reply via email to