When I run the command:
awk '/from/ {print $7} /to/ { print $7}' erroMuitoDoido.txt
The file is:
May 19 04:44:43 server postfix/smtpd[32595]: CDAB515013: client=servidor.dominio.com.br[10.10.10.44]
May 19 04:44:43 server postfix/cleanup[18651]: CDAB515013: message-id=<20120519074443.CDAB515013@servidor2.dominio.com.br>
May 19 04:44:43 server postfix/qmgr[16684]: CDAB515013: from=atendimento@dominio.com.br, size=19590, nrcpt=1 (queue active)
May 19 04:44:50 server postfix/pipe[32596]: CDAB515013: to=userdestino@dominiodestino.com.br, relay=dovecot, delay=6.2, delays=0.02/6/0/0.14, dsn=2.0.0, status=sent (delivered via dovecot service)
May 19 04:44:50 server postfix/qmgr[16684]: CDAB515013: removed
The output is:
from=atendimento@dominio.com.br,
from=atendimento@dominio.com.br,
to=userdestino@dominiodestino.com.br,
The problem is that the line "from=atendimento@dominio.com.br," occurs twice! How can I fix this?
AWK version: GNU Awk 4.0.0
OS: Debian 6, OpenSuse 12.1, CentOS 6.2