I am having trouble with a perl Script

Posted by Jonathan Mori on Stack Overflow See other posts from Stack Overflow or by Jonathan Mori
Published on 2012-10-31T04:47:44Z Indexed on 2012/10/31 5:01 UTC
Read the original article Hit count: 217

Filed under:

I have web log files and I was having a lot of trouble, being new with perl. I just need a script to find a count of each of the images that were found. I was able to list them but I'm unsure of how to just get a count, say something like "There were x jpgs and x gifs viewed".

The web logs look like this.

24.131.83.162 - - [28/Jan/2007:00:00:00 -0500] "GET /~taler/images/index_09.jpg   HTTP/1.1" 200 1563
207.46.98.53 - - [28/Jan/2007:00:00:04 -0500] "GET /%7Edist/programs/PhD/PhDGuide/guideA.htm HTTP/1.0" 200 19090
74.6.74.184 - - [28/Jan/2007:00:00:12 -0500] "GET /%7Embsclass/hall_of_fame/myicon.ico HTTP/1.0" 200 760
58.68.24.3 - - [28/Jan/2007:00:00:16 -0500] "GET /~dtipper/tipper.html HTTP/1.1" 200 5896
58.68.24.3 - - [28/Jan/2007:00:00:16 -0500] "GET /~dtipper/gifs/head.jpg HTTP/1.1" 200 18318

© Stack Overflow or respective owner

Related posts about perl