Welcome to WebmasterWorld Guest from 54.146.22.61

Forum Moderators: bakedjake

Message Too Old, No Replies

Can get uniq to work as intended

     
9:34 pm on May 17, 2007 (gmt 0)

Junior Member

10+ Year Member

joined:Apr 18, 2006
posts:115
votes: 0


I'd like to know how many people visited a specific part of my website during the month of april so i use this:

cat access_log  grep /Apr/  grep multimedia 

This works fine.

But i want to filter out duplicates based on IPs, so i can get number of unique visitors.

So i add this:

cat access_log  grep /Apr/  grep multimedia [b]  uniq -w 15 -i [/b]

But it simply will not give me unique lines based on the first 15 characters.

So whats the problem?

Thanks in advance.

3:23 pm on May 19, 2007 (gmt 0)

Junior Member

10+ Year Member

joined:Apr 18, 2006
posts: 115
votes: 0


a simple question, but apparently no simple answer :(
5:27 pm on May 19, 2007 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 31, 2003
posts:1316
votes: 0


I'm not sure -- it seems to work for me. But if you just want the number of visitors, try it like this:

grep '/Apr/' access_log grep multimedia cut -f1 -d ' ' sort -u wc -l

6:58 pm on May 19, 2007 (gmt 0)

Junior Member

10+ Year Member

joined:Apr 18, 2006
posts: 115
votes: 0


Thanks, that worked exactly as intended. Strange that uniq doesnt work...