LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Closed Thread
 
Search this Thread
Old 06-29-2004, 04:55 PM   #1
skelly
LQ Newbie
 
Registered: Nov 2003
Location: Silicon Valley
Posts: 10

Rep: Reputation: 0
"Real-time" Apache Log Filtering


Wondering if anyone else here has ever messed around with access log filtering on Apache. I borrowed some perl code from the URL:
Quote:
norman.walsh.name/2003/08/25/logfilter
scrapped most of the contents and wrote my own body section with logic pertaining to the type of filtering that I need.

The problem that I'm having is that the filter doesn't launch once and then remain resident. It keeps launching, processing several lines of logging as they arrive from apache, and then terminating. It terminates with an exit code of 0 or 1, cause of the code unknown, and the code itself appears in the log file. I know that it's respawning because I added a print() statement at the top of the script that shows when it has been freshly instantiated, and sure enough, like clockwork the filter restarts every 10 seconds.

My understanding from the rather slim documentation I've found on filters is that the script should be instantiated once and then stay alive for the entire time that the server is running. Is this false? Is there any way to make it stop? The way the filter is invoked is by setting up:

CustomLog "| /myfilter.pl | /path/rotatelogs... yadda yadda"

It just gets inserted into the pipe there, receives log messages on stdin and pops filtered messages back on stdout which are received by the normal logging system.

Well I'd appreciate any tips on direction. My script is required to operate for days at a time in order to build internal records against which to filter. The 10 second intervals won't work be sufficient. Unfortunately I can't post my own script as it is considered intellectual property for the company, but the gist is the same as the code linked above. Mine appends each log line with a new field that I can use a log post-processor to retrieve and display new statistics on.

Thanks,
- SK

PS: if someone could edit the URL above and turn into a real link, that would be helpful. The site's anti-spam policy prevents me from doing it myself.

Last edited by skelly; 06-29-2004 at 05:26 PM.
 
Old 06-30-2004, 02:16 PM   #2
mcleodnine
Senior Member
 
Registered: May 2001
Location: Left Coast - Canada
Distribution: s l a c k w a r e
Posts: 2,731

Rep: Reputation: 45
Please do not post the same thread in more than one forum. Picking the most relevant forum and posting it once there makes it easier for other members to help you and keeps the discussion all in one place.

http://www.linuxquestions.org/rules.php

Please continue with the thread at http://www.linuxquestions.org/questi...hreadid=199299
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
real time programming on Linux-2.4 " URGENT" mendiratta Programming 1 05-26-2005 08:20 AM
System hanging at "Real Time Clock Driver" raccoon Linux - General 3 07-15-2004 02:57 PM
"Real time" Apache log filtering with Perl skelly Programming 1 07-01-2004 02:24 PM
System freezing at "Real Time Clock Driver" raccoon Linux - Newbie 0 12-02-2003 02:51 AM
/var/log/messages contains "localhost" instead of the real hostname allel Linux - Networking 0 07-15-2002 02:49 PM


All times are GMT -5. The time now is 05:14 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration