[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: getting meaningful access logs



* John Griffiths (john@capmon.com) [011120 22:26]:
> i've tried:
> 
> $tail -f /var/log/apache/access.log |grep  "[php|/ HTTP]" (still get everything)
> 
> $tail -f /var/log/apache/access.log |grep -v "[jpg|gif]" (get nothing)

These are wrong. square brackets denote character classes. The first
rule matches any line with any of the following characters in it:
p h | / H T P
which is everything.

The second rule matches any line not containing any of  j p g | i f .

You see my point. You're really looking for parentheses, I think,
instead of square brackets. Use \(\) with grep or just () with egrep.

good times,
Vineet

-- 
Satan laughs when      #  "I disapprove of what you say, but I will
we kill each other.    #   defend to the death your right to say it."
Peace is the only way. #  --Beatrice Hall, The Friends of Voltaire, 1906

Attachment: pgpSAn6G1p600.pgp
Description: PGP signature


Reply to: