homepage Welcome to WebmasterWorld Guest from 54.204.94.228
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
Forum Library, Charter, Moderators: bakedjake

Linux, Unix, and *nix like Operating Systems Forum

    
Can get uniq to work as intended
darkage




msg:3342435
 9:34 pm on May 17, 2007 (gmt 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.

 

darkage




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

a simple question, but apparently no simple answer :(

mcavic




msg:3344052
 5:27 pm on May 19, 2007 (gmt 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

darkage




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

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved