On Wed, Jun 17, 2009 at 11:53:27AM -0400, wesleywu wrote:
I need to monitor access log in a separated application, to identify frequentvisits like DoS attack.
Now I'm using apache httpd. CustomLog directive of httpd (equivalent toaccess_log directive in Ngnix) supports write log lines to the stdin of a pipedapplication.
Quote from http://httpd.apache.org/docs/2.2/mod/mod_log_config.html
Syntax: CustomLog file|pipe format|nickname environment-variable]
The pipe character "|", followed by the path to a program to receive the loginformation on its standard input.
Will Ngnix support this feature? Or is there any solution to monitor every logline of access_log?
No, nginx will not support logging to a pipe since this is simlpy waste of CPU.
You may try
tail -F /path/to/log | app
This is almost the same waste of CPU as piped log.