Log file analyzer and take action based on frequency of event

In Progress

I am looking for a very simple PHP script that will be executed via a cron job once per minute to identify if someone is spamming (think DoS attack) my site causing high load and needs to be blocked.

The script will first check the current load of the server (1 min). If the load is over the threshold (say [url removed, login to view], but make it a variable) then the next step is to l read an nginx access log file, which I will provide a sample of. I then need to count the number of times an IP address appears in the log over a set period of time (in seconds). I am unsure of this figure, so it needs to be configurable as a variable in the script.

If the log file contains too many matches (IP address is occurring too often in the log within a certain time period) then I need an exec() command issued, which is basically a command of: ufw insert 1 deny from . I then need the output of that command captured and emailed to me along with the gzip'd log file using php mail.

The log file is standard nginx access log format. I can provide a snippet.

Skills: PHP, Software Architecture

See more: job event, action script job, log time, log me in, gzip, frequency, cron command, action figure, server load log, insert variable, script gzip, simple analyzer, job log analyzer, ufw , software cron, php exec command, event check php, simple php log, output analyzer, check sample file, event check, simple job log, check file format, log file, php nginx

Project ID: #4171680

Awarded to:

onlymaj

hi mr.i read your project details and i can do it for you.we can discuss more about that.we can start if you are intrested.

$75 USD in 7 days
(4 Reviews)
3.6

3 freelancers are bidding on average $85 for this job

goodperlcoder

Hi! I'm ready do it now, just accept my bid

$80 USD in 3 days
(3 Reviews)
2.7
gabrola

Hello, I've worked previously on similar solutions. Check my portfolio and feedback on my profile.

$100 USD in 5 days
(1 Review)
1.0