Apache ErrorLog write log and execute Python script -



Apache ErrorLog write log and execute Python script -

i'm trying write apache 2.4 errors error log , sending them graylog2 server using python script. looking @ examples such http://www.fnal.gov/docs/products/apache/syslog_logs_notes.html , http://zindilis.com/docs/apache-logs-to-remote-syslog.html. examples show should utilize tee, example:

errorlog "| tee -a /var/log/httpd/error_log | nc -u -j syslog.example.com 514"

i'm doing following:

errorlog "| /usr/bin/tee -a /var/log/httpd/domains/test.error.log | /usr/bin/python /opt/apache2gelf/test.py"

the messages written logs python script not executed. python script has 755 permissions. missing here?

try:

errorlog "| /usr/bin/tee -a /var/log/httpd/domains/test.error.log | xargs /opt/apache2gelf/test.py"

and create sure first line of script proper interpreter, e.g #!/usr/bin/env python

python apache graylog2

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -