procmail
[Top] [All Lists]

Re: counting how often my rules hit with LOGFILE

2002-08-27 03:33:53
On Tue, 27 Aug 2002, Fuzzy Logic wrote:

Out of curiosity, I wanted to see how often each of my rules was used in
an average day, so I turned on VERBOSE and LOGFILE.  Now, I have a
question.  I searched the archives, but didn't find anyone who had asked a
similar question.
[...]
My question is this:  Is there a way to ask procmail to just tell me a hit
and not all the misses (ie, not use VERBOSE, but still get the "Match on"
line)?

        I do not kno this flag but, you can LOG your matches in this way:

LOGABSTRACT=no
VERBOSE=no
:0 ...
* Does it match my string?
{
LOG="Found:$MATCH
"
        :0
        The action
}


        To account the matches:

awk -F":" '/Found/ {x[$2]+=1}; END {for(i in x) print i,x[i]}' lgofile

        Will give you table of all matches and counters.

Bye,
 Udi

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail