Hi all,
I am new to this group. I need help regarding a perl script which parses the web log file, access_log.
Welcome , This is the most friendly list I have seen
The format of the access_log is:
127.0.0.1 - - [15/Jun/2003:13:54:02 -0100] "GET /xxxx HTTP/1.1" 200 34906
The goal is to
<snip>
What do You expect ? Someone would write a full program for you to use ?
Someone might, but that way you will take a long time to do real perl yourself
Best way to use a newsgroup is to write out a code yourself, If you get stuck post what You have done and what is not working
You will get enough help here
You seem to have a fairly simple thing A short algo will be
write a function that will convert a timestamp to a date_range_string like
foo('15/Jun/2003:13:54:02')='15/Jun/2003:13:45:00-15/Jun/2003:14:00:00' ... .. # Use a smaller string if you find this range string very long ..
Now read the file line by line while(<FILE>){ ($x,$y,...$timestamp,....) = split; # Fill in the blanks later $hash{foo($timestamp)}++; }
Now %hash has got all info you need
Best of Luck Ram
PS BTW Have a look at analog http://www.analog.cx/ before you write any code yourself. You might find what you want
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]