RE: !Postprocess and e-mailed summary report
"Robin Bowes" <[email protected]>
| Newsgroups | gmane.comp.djb.syslog |
|---|---|
| Message-ID | <[email protected]> |
Paul Jarc <mailto:[email protected]> wrote on 10 October 2003 17:08: > "Robin Bowes" <[email protected]> wrote: >> 2. How to mail a summary report while maintaining the full log files >> and their rotation. > > There's one thing I'm not clear on: what is in those rotated log files > for John? Is it the verbatim data that was in the current logs, piped > through messagewallstats without being changed? > messagewallstats doing some sort of processing? If there's no > processing going on, then I'd skip the patch and use the "cat > previous" method. (I would have suggested that the first time around, > if I had understood that messagewallstats isn't doing any processing.) > OTOH, if messagewallstats is doing some processing, then of course > "cat previous" won't work for John, and John's patch won't work for > Robin, since they want different behavior. John's patch inserts a line to write out the line read from stdin to stderr: fprintf(stderr,"%s",line); There is no additional processing involved. My patch will work for John. In fact, John can achieve what he requires without patching messagewallstats at all! This should do the trick with vanilla messagewallstats: #!/bin/sh exec /usr/local/bin/setuidgid mwall \ /usr/local/bin/multilog t \ "!messagewallstats /dev/stdin \ | qmail-inject postmaster \ && exec cat previous" \ s1000000 ./main \ s1000000 -* +*DNSBL/WARNING* ./main/DNSBL R.