[PLUG] egrep help please

Steven A. Adams stevea at nwtechops.com
Wed Feb 5 21:46:01 UTC 2003


On Tue, 2003-02-04 at 23:33, Rogan Creswick wrote:
> 
> egrep -c "/gba/.*_small.jpg" /var/log/httpd/access_log 
> 
> should work, but I'm no grep master. The idea is that you are grepping
> for /gba/ followed by some set of characters (.* the "." usually means
> any one char. the "*" means any number of times) followed by the
> string _small.jpg.
> 
> This did what I expected on a test example I had laying arround, if
> you wanted to do a true AND, you would need something more
> complex.. but I'm guessing the /gba/ always comes before the
> _small.jpg
> 
> -Rogan
> 
> 
> On Tue, Feb 04, 2003 at 11:14:35PM -0800, Mike De La Mater wrote:
> > My son is selling his game boay advance on ebay. I'm hosting the picures on my server, because I'm cheap and 
> > nothing sells like photographs. (except touch, bu apache doesn't do that yet)
> > 
> > I'm wanting to do a little specialized analysis of my log files. I want to know how many looks at the files 
> > with "/gba/" AND "_small.jpg" and how many looked at the files that were only "/gba/" this will tell me how 
> > many clicked on the link for a much larger image to really check out his item. Part of the problem is that 
> > there are other entries in the log that have "_small.jpg" in them.
> > 
> > I'm using egrep like this:
> > egrep -c "/gba/" /var/log/httpd/access_log
> > THis gives me half of what I want.
> > 
> > I've tried:
> > egrep -c "/gba/|_small" /var/log/httpd/access_log
> > but it gives me an EITHER search, not what I wanted. I cannot find an AND in the man page, maybe because it's 
> > too simple to specify.
> > 
> > Is there a character for this, or will egrep even do this?
> > 
> > 
> > 
> > Mike De La Mater
> > Small business networks and technology consulting
> > 503-702-6749
> > mikedela at ipns.com 
> > 
> > 
> > 
> > 
> > _______________________________________________
> > PLUG mailing list
> > PLUG at lists.pdxlinux.org
> > http://lists.pdxlinux.org/mailman/listinfo/plug
> 
> _______________________________________________
> PLUG mailing list
> PLUG at lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
> 






More information about the PLUG mailing list