From: Israel Garcia on
I know there're a lot of postfix stats programs, but how can I get
ONLY, the total number of email sent by postfix except for a couple of
local domains? Can you help me?

thanks for your time
--
Regards;
Israel Garcia

From: Israel Garcia on
On Fri, Apr 23, 2010 at 2:47 PM, Tonu Samuel <tonu(a)jes.ee> wrote:
> On Fri, 2010-04-23 at 14:44 +0200, Israel Garcia wrote:
>> I know there're a lot of postfix stats programs, but how can I get
>> ONLY, the total number of email sent by postfix except for a couple of
>> local domains? Can you help me?
>
> awk does it.
Hi Tonu,
:-) I suppose awk does.. maybe grep too but, I don't know how.. can
you help me?

thanks in advance
regards
Israel.

>  Tõnu
>
>



--
Regards;
Israel Garcia

From: Tonu Samuel on
On Fri, 2010-04-23 at 14:50 +0200, Israel Garcia wrote:
> On Fri, Apr 23, 2010 at 2:47 PM, Tonu Samuel <tonu(a)jes.ee> wrote:
> > On Fri, 2010-04-23 at 14:44 +0200, Israel Garcia wrote:
> >> I know there're a lot of postfix stats programs, but how can I get
> >> ONLY, the total number of email sent by postfix except for a couple of
> >> local domains? Can you help me?
> >
> > awk does it.
> Hi Tonu,
> :-) I suppose awk does.. maybe grep too but, I don't know how.. can
> you help me?

Ok. Let's do it with grep:

grep /var/log/mail.log | grep Sent | grep -rvi "dom1.com\|dom2.com" | wc

Have not tested it but this is the idea.

grep flags:
-r regular expression (to make | work)
-i case insensitive
-v match things NOT in expression

wc counts chars, words and lines. Last one is what you want. You can
add

cut -f 3 -d ' '

to cut out third field in space separated line.

http://www.vectorsite.net/tsawk.html can be useful too.


Tõnu

From: Israel Garcia on
Thanks tonu, working now!..

regards
Israel.

On Fri, Apr 23, 2010 at 4:26 PM, Tonu Samuel <tonu(a)jes.ee> wrote:
> On Fri, 2010-04-23 at 14:50 +0200, Israel Garcia wrote:
>> On Fri, Apr 23, 2010 at 2:47 PM, Tonu Samuel <tonu(a)jes.ee> wrote:
>> > On Fri, 2010-04-23 at 14:44 +0200, Israel Garcia wrote:
>> >> I know there're a lot of postfix stats programs, but how can I get
>> >> ONLY, the total number of email sent by postfix except for a couple of
>> >> local domains? Can you help me?
>> >
>> > awk does it.
>> Hi Tonu,
>> :-) I suppose awk does.. maybe grep too but, I don't know how..  can
>> you help me?
>
> Ok. Let's do it with grep:
>
> grep /var/log/mail.log | grep Sent | grep -rvi "dom1.com\|dom2.com" | wc
>
> Have not tested it but this is the idea.
>
> grep flags:
> -r regular expression (to make | work)
> -i case insensitive
> -v match things NOT in expression
>
> wc counts chars, words and lines. Last one is what you want. You can
> add
>
> cut -f 3 -d ' '
>
> to cut out third field in space separated line.
>
> http://www.vectorsite.net/tsawk.html can be useful too.
>
>
>  Tõnu
>
>



--
Regards;
Israel Garcia