Help Me To Build Shell Script

Hello,

I need someone to help me to build a script in bash compatible with Linux and BSD (unix).

This project is not all the script but just a part and will consist to make statistics of each ip that send too many request on a site HTTP.
All the work will be done by analist the log file of http access.
The script will work with all much possible variable to make it portable and integrable with others script/programs.

The script will do:

– Read the log file
– count the max unique request of each IP
– write on a text file the ip that are send more request
– generate a stats of all HTTP error and report how much request by have done the ip by sort the http error on another text file, only for the ip that are opened too mach request

The variable:

$logfile= where is the log file to analysis
$maxureq= the max number of request http, if more the script will add the ip on the file.txt
$timeureq= max time in minutes that an ip can open $maxureq, if more than the value $maxureq will be not valid (for example, $maxureq=100 and $timeureq=10, an ip will add on the file.txt only if the client ip open 100 request in less than 10minutes, if in more time will be not consider).

Also, if possible, the IP on file.txt can be used by a variable for iptables and ipfw rules.

That’s all.

Not so difficult because i’m able to do this but i need co-operation.
An expert of Bash programming can done this in 1hour.

Thank you

Leave a Reply

Your email address will not be published. Required fields are marked *