Hello,
I have a Apache webserver running on RedHat. Its primary function is a proxy server for users accessing the internet. I have a transaction log that logs every transactions of every users. For users trying to access certain sites/content the transactions goes into a 302 redirect loop and the browser eventually throws the error. Basically I need a script that will continuously watch the transaction log in real time and if it sees 5 or more consecutive redirect from the same user to to same site then redirect them to a certain site like
http://testsite.com
Below is the transaction log format
sourceIP of the end user <timestamp> content/site being accessed result code
206.40.1.2 [25/Feb/2009:09:13:36 -0600] GET
Google HTTP/1.1" 302
So if the script sees something like below then the last redirect would be
http://testsite.com
206.40.1.2 [25/Feb/2009:09:13:36 -0600] GET
Google HTTP/1.1" 302
206.40.1.2 [25/Feb/2009:09:13:37 -0600] GET
Google HTTP/1.1" 302
206.40.1.2 [25/Feb/2009:09:13:38 -0600] GET
Google HTTP/1.1" 302
206.40.1.2 [25/Feb/2009:09:13:39 -0600] GET
Google HTTP/1.1" 302
206.40.1.2 [25/Feb/2009:09:13:40 -0600] GET
Google HTTP/1.1" 302
Any help would be really appreciated.
Thanks
Bruno