RE: MATCH variable usage in log files
"Dallman Ross" <[email protected]> Wed, 19 Mar 2003 21:45:20 +0100
| Newsgroups | gmane.mail.procmail.devel,gmane.mail.procmail |
|---|---|
| Organization | Nomotek |
| Message-ID | <!~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAAfIuZ1uAZ0BGnLERFU1QAAMKAAAAQAAAAQtmbj/[email protected]> |
"Don" wrote: > I'm a new list subscriber and despite a great deal of reading in the > archives, I've been unable to find any reference to the problem I'm > having at the moment. I wish it weren't true, but this developer's list seems mostly dead, except to spammers. I strongly suggest you resubmit your query to the standard procmail list and join that. It, at least, is generally free from spam (though they will still harvest your address from it, so be careful). "procmail -v" will get you a bad main list address, btw, in 3.22, though I don't know about 3.15. Here is the list address: [email protected] Also, see www.procmail.org . I will cc. the regular list here. But suggest you join it. > I'll try to be brief... I'm using a MySQL database and a small perl > program to generate /etc/procmailrc... it works just fine, and I've > set it up as a cron job so changes to the database are reflected in > procmailrc on a timely basis. >=20 > I also wrote a couple of awk scripts that take my /var/log/maillog and > my procmail logs and feed them to MySQL as well. The idea was to build > a comprehensive evaluation tool... and they work pretty good. >=20 > Then I wrote some php scripts so I could search and sort through the > logs to evaluate the performance of my recipes using a web interface. > The object is to get rid of spam, of course... and it generally works > very well. >=20 > Here's my problem: I want to be able to evaluate exactly which recipes > are doing the work. (I've assembled a couple hundred key words and > phrases which I want to catch)=20 >=20 > If I leave VERBOSE=3Dyes in my procmailrc, I get the match information = I > need, and I can parse the logs into a database, no problem.=20 >=20 > Unless, of course, a bunch of mail comes in rapidly, in which case the > log entries aren't always contiguous.=20 Okay, if you are going to depend on logs to that extent, then you probably want to reassign LOGFILE based on something unique or at least unusual. Two things that people sometimes use are "$$" (the process number) or gdate's time-since-creation (1/1/1970) in seconds. > From reading, I think intuitively that the using LOG variable and > VERBOSE=3Dno is going to be the solution. (If I could cut down the = sheer > volume of the logfile, I think I'd experience less garbling)=20 >=20 > I've been reading the list contents, and I've learned that $MATCH > isn't any kind of special variable. I thought it was... and that I > could just print the contents into the log. Apparently I have to load > the LOG variable with the information I want to log... and I seem to > be unable to figure out how to get the recipe match information (i.e. > that ONE LINE out of all that info that appears when VERBOSE=3Dyes) = into > it. >=20 > Would someone be so kind as to point me in the direction of the > appropriate docs... or otherwise assist? First, set LOGABSTRACT=3Don. Then do something like NL=3D" " LOG=3D"$NL \$MATCH was set to $MATCH $NL" Hth, Dallman