Click to See Complete Forum and Search --> : counting hits and uniques using grep


quenting
03-01-2004, 11:06 AM
hello,
what grep command should i use to retrieve total hits and unique visitors (well, unique IPs) on a given date from a webserver file (apache clf) ?

Thanks!

ph34r
03-01-2004, 11:23 AM
www.analog.cx

quenting
03-01-2004, 11:52 AM
thanks, but i don't need a log file analyzer, i need a unix command.
id guess
grep -c '29/Feb/2004' access_log
would give me the number of hits (right ?), but how to retreive unique IPs ?

Cheers,
Quentin

quenting
03-01-2004, 12:22 PM
does this seem correct ?

count:
grep -c '29/Feb/2004' logfile

uniques:
grep '29/Feb/2004' logfile | cut -d ' ' -f1 | sort | uniq | wd