Mailing List Archive

More logging questions - hostname again
Hi again.

Still fumbling around with the logs..
I have a feeling this has been mentioned before, but I can't find it right
now.

The problem is that AWstats really need a separate field for server hostname
(apache: %v) to filter separate vhosts on.

I'ts not good to use a simple regexp filter since referer could trigger a
false match.

I've tried various variants of:

varnishncsa -c -I 'hostname' -r /var/log/varnish/varnish.log

but without luck.

The only option I can think of right now is to make my own log preprocessor to
split the hostname out of the request.
(quite unusual place to have it, is it not?)

Any sed wizards out there?
sed -e 's#\("\([A-Z]\+\) http://\([^/]*\)\)#\3 \1#g'

Or any better sugestions?

Regards

Gaute Amundsen
More logging questions - hostname again [ In reply to ]
Gaute Amundsen <gaute at pht.no> writes:
> The problem is that AWstats really need a separate field for server
> hostname (apache: %v) to filter separate vhosts on. [...] The only
> option I can think of right now is to make my own log preprocessor to
> split the hostname out of the request. [...] Or any better
> sugestions?

Take the varnishncsa source code and modify it to produce what you need?
It's really not that hard, just modify the bottom half of h_ncsa().

I intend to eventually modify varnishncsa to understand Apache CustomLog
format strings, but I have more pressing issues to handle first.

DES
--
Dag-Erling Sm?rgrav
Senior Software Developer
Linpro AS - www.linpro.no
More logging questions - hostname again [ In reply to ]
Dag-Erling Sm?rgrav <des at linpro.no> writes:

> I intend to eventually modify varnishncsa to understand Apache
> CustomLog format strings

Now, that's really high on the nice-to-have list. :D

--
Stig Sandbeck Mathisen, Linpro
More logging questions - hostname again [ In reply to ]
On Wednesday 27 June 2007 22:10, Dag-Erling Sm?rgrav wrote:
> Gaute Amundsen <gaute at pht.no> writes:
> > The problem is that AWstats really need a separate field for server
> > hostname (apache: %v) to filter separate vhosts on. [...] The only
> > option I can think of right now is to make my own log preprocessor to
> > split the hostname out of the request. [...] Or any better
> > sugestions?
>
> Take the varnishncsa source code and modify it to produce what you need?
> It's really not that hard, just modify the bottom half of h_ncsa().

Thanks for the pointer.
I guess I'm sometimes more reluctant to touch C that is strictly waranted :-/

> I intend to eventually modify varnishncsa to understand Apache CustomLog
> format strings, but I have more pressing issues to handle first.
>
> DES

That would be just the thing :)
But for now it seems that sed pipe seems to be pretty stable.
I guess I ought to add it to the wiki or make a tiny howto or something...?

Gaute