Welcome to WebmasterWorld Guest from 54.144.48.103

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Mini Web Log Analyzer?

...help!

     
4:11 pm on Nov 25, 2003 (gmt 0)

10+ Year Member



Greetings!

I'm trying to do a tiny code that gets an IP "route" through our site. Like, gets an IP from a field, opens a log file into an array, compares the IP and creates a new array with only the matches(composed only of .htm or .php files), and prints it. Thing is, I'm having some issues with the code(with all the code, lol), mostly with the "open log" part. Our logs are very big(7k visits daily) and it takes a LOT of time to even open it in the first place. Isn't there a way to open it in "pieces"? (like, 20MB at a time) or do I need to manually split the log file? Do you know an already finished script that does this?

Thanks in advance!

4:46 pm on Nov 25, 2003 (gmt 0)

10+ Year Member



Hi,

I'd advise you to look into logging to a database for this kind of thing. Or, take a look at PhpOpenTracker (www.phpopentracker.de), an excellent Open Source project that will do exactly what you are after and a lot more.

5:51 pm on Nov 25, 2003 (gmt 0)

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member



opening it with fopen shouldn't be an issue. The real problem with log parsers is the sheer volume of data you need to read through and compare.

I have one and it runs in seperate parts. I run a clean up script first which dumps a fair amount of data and stores the rest into another file. I then do all of the comparisons/searches/counts on that. It saved a lot of processing time.

You could have apache rotate the logs more often so that it gives you smaller pieces to deal with.

 

Featured Threads

Hot Threads This Week

Hot Threads This Month