public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Felix Miata <mrmazda@earthlink.net>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] is a nice "place" :-D
Date: Mon, 16 May 2011 20:38:21 -0400	[thread overview]
Message-ID: <4DD1C37D.4050908@earthlink.net> (raw)
In-Reply-To: <201105170133.39864.alan.mckinnon@gmail.com>

On 2011/05/17 01:33 (GMT+0200) Alan McKinnon composed:

> grep "GET /Tmp/Linux/G" | /var/log/apache2/access_log | grep-v<myip>  | \
> 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 <myip>  | \
	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 <myip>  | \
	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 <myip>  | \
	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/



  parent reply	other threads:[~2011-05-17  0:40 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-16 23:10 [gentoo-user] is a nice "place" :-D Felix Miata
2011-05-16 23:33 ` Alan McKinnon
2011-05-17  0:36   ` Willie Wong
2011-05-17  0:38   ` Felix Miata [this message]
2011-05-17  7:25   ` Neil Bothwick
2011-05-17 10:43     ` Pandu Poluan
2011-05-17 13:10       ` Juan Diego Tascón
2011-05-17 13:36         ` Alex Schuster
2011-05-17 13:51           ` Juan Diego Tascón
2011-05-17 14:34           ` Pandu Poluan
2011-05-17 17:38       ` Stroller
2011-05-18 10:17         ` Neil Bothwick
2011-05-18 19:03           ` Alan McKinnon
2011-05-18 20:04             ` Neil Bothwick
2011-05-18 20:15             ` Alan Mackenzie
2011-05-18 20:28               ` Alan McKinnon
2011-05-19 19:01                 ` Walter Dnes
2011-05-17 14:30   ` David Haller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DD1C37D.4050908@earthlink.net \
    --to=mrmazda@earthlink.net \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox