Analyze Apache Log File

Words: 216
Pages: 1
Subject: Uncategorized

Refer to the apache_access.log file. Every row is a request on a web server. Some are pages, some are images, some are JavaScript files. That’s not important right now though. We are going to focus on the first field of every line, which is the IP address of the requester.

Please see attached File

As you know, every device uses the IP address 127.0.0.1 to refer to itself. So, visitors arriving from that IP address are coming from the same machine. Your task is to write a scriipt that will count how many requests came from 127.0.0.1 and how many from elsewhere. For your submission, please provide your code for review.

Basic steps:

1. Open the file for reading or die
2. Chomp remove trailing newlines
3. Use index function
4. Use substr function

Note: You may also use a regular expression (regex) if you want.

Let Us write for you! We offer custom paper writing services Order Now.

REVIEWS


Criminology Order #: 564575

“ This is exactly what I needed . Thank you so much.”

Joanna David.


Communications and Media Order #: 564566
"Great job, completed quicker than expected. Thank you very much!"

Peggy Smith.

Art Order #: 563708
Thanks a million to the great team.

Harrison James.


"Very efficient definitely recommend this site for help getting your assignments to help"

Hannah Seven