From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QM8Ke-0002ME-7Y for garchives@archives.gentoo.org; Tue, 17 May 2011 00:40:16 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 66D6D1C10E; Tue, 17 May 2011 00:38:22 +0000 (UTC) Received: from pop-satin.atl.sa.earthlink.net (pop-satin.atl.sa.earthlink.net [207.69.195.63]) by pigeon.gentoo.org (Postfix) with ESMTP id 3B1A71C10E for ; Tue, 17 May 2011 00:38:17 +0000 (UTC) Received: from user-12hck1e.cable.mindspring.com ([69.22.80.46] helo=[192.168.0.51]) by pop-satin.atl.sa.earthlink.net with esmtp (Exim 3.36 #1) id 1QM8Ii-0000WQ-00 for gentoo-user@lists.gentoo.org; Mon, 16 May 2011 20:38:16 -0400 Message-ID: <4DD1C37D.4050908@earthlink.net> Date: Mon, 16 May 2011 20:38:21 -0400 From: Felix Miata Organization: less than infinite User-Agent: Mozilla/5.0 (OS/2; Warp 4.5; rv:2.0.1) Gecko/20110513 SeaMonkey/2.1 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] is a nice "place" :-D References: <4DD1AEC8.5010501@earthlink.net> <201105170133.39864.alan.mckinnon@gmail.com> In-Reply-To: <201105170133.39864.alan.mckinnon@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Archives-Salt: X-Archives-Hash: 5856ce3f909613c48dfb64e4a454a33c On 2011/05/17 01:33 (GMT+0200) Alan McKinnon composed: > grep "GET /Tmp/Linux/G" | /var/log/apache2/access_log | grep-v | \ > awk '{print $1}' | sort | uniq | wc > In true grand Unix tradition you cannot get quicker, dirtier or more effective > than that It almost worked too. :-) grep "GET /Tmp/Linux/G" /var/log/apache2/access_log | grep -v | \ awk '{print $1}' | sort | uniq | wc -l got me almost what I wanted, 20 unique IPs, but that's a lot of stuff to remember, which for me will never happen. So I tried converting to an alias. grep "GET $1" | /var/log/apache2/access_log | grep -v | \ awk '{print $1}' | sort | uniq | wc -l sort of works, except I won't always be looking for GET as part of what to grep for, or might require more than one whitepsace instance, and am tripping over how to deal with the whitespace if I leave GET out of the alias and only put on cmdline if I actually want it as part of what to grep for. grep "GET $1 $2" | /var/log/apache2/access_log | grep -v | \ awk '{print $1}' | sort | uniq | wc -l seems to work, but I'm not sure there aren't booby traps besides 2nd or more whitespace instances I'm not considering, even though it gets the same answer for this particular case. -- "The wise are known for their understanding, and pleasant words are persuasive." Proverbs 16:21 (New Living Translation) Team OS/2 ** Reg. Linux User #211409 ** a11y rocks! Felix Miata *** http://fm.no-ip.com/