About LogSearch v1, by Dave:
This script works in both UNIX (see below for Linux info) and ActiveState perl. I wrote this to help make searching remote web server log files easier. LogSearch is a sockets based program that comes in two parts, the client and server. The "server.pl" goes into your weblog directory on your webserver. The client program "client.pl" is run from your workstation. You simply run client.pl and enter whatever flag you want to search your log files for i.e.: Googlebot, or even .exe or../../ .The server will receive that flag and search your log files. When it has found all the entries that match the flag it sends that data to the client program on your workstation. The client program will then write that data to a word file (.doc) for viewing.
*NOTE: Windows users, you will need to install either Cygwin or ActiveState Perl on any machine you want to run Perl scripts on.
*NOTE: You will have to give Perl access to the internet through your firewall where applicable. Or just open the ports this program uses (UDP 1777 and 1778)
Setting it up…how to:
Set the $host and $UNIX variables in the code (both server.pl and client.pl
need to be configured).
ON THE WEB SERVER
Place the server.pl and results.temp files into your weblog directory on your web server:
Run the “server.pl” file. If you are using Cygwin UNIX then just launch it from the command line like this: root@localhost# perl server.pl .If you are running it under ActiveState then just click on the program icon. Once the server program has started you will see this prompt:
This means the server is running and waiting for data to be sent to it.
If you want you can set up server.pl to run as a scheduled task and it will
run even if you don’t log on to the server and you don’t have to manually
launch anything. Also if you set it up to run as a scheduled task when you
do log onto the web server you will not see any console screen. It will
basically run like any other Windows service. It’s pretty low maintenance.
To kill the server.pl program when it is set to run as a ‘service’ just
send the ‘svrexit’ flag via the client or open your task manager and kill
the perl.exe process.
ON YOUR WORKSTATION
Now
run the client on your workstation. You will see the below prompt:
Now
just enter the flag you want to search for…we’ll do Googlebot
for now.
You will see that the flag was successfully sent to the server and the server sent back the results. The client then logged the results to “results.doc”.
Open results.doc in Micro$oft Word (or equiv) to view the results from your log files.
BASIC DIAGRAM:
==============================================================
LINUX/UNIX support:
Logsearch runs on Linux as well as windows. this program was not originally written for Linux but I made a few modifications and this program should also work on Apache web server ( it might need some more modifications to work on your individual system).