0

I want to search my log-files and only show unique email-addresses that is preceeded by "MAIL FORM:"

For example if I search maybe I got those hits:

Mon 2014-03-17 00:01:38: <-- MAIL FROM:<noreply@attraccs.com>
Mon 2014-03-17 00:01:38: noreply@attracs.com is an alias for ThoFager@aholatransportt.fi
Mon 2014-03-17 00:01:38: --> 250 <noreply@attraccs.com>, Sender ok
Mon 2014-03-17 00:01:38: <-- RCPT TO:<tiina.pitkahjarvi@enervent.fi>
Mon 2014-03-17 00:01:38: --> 250 <tiina.pitkajarvi@enervent.fi>, Recipient ok
Mon 2014-03-17 00:01:38: <-- RCPT TO:<benita.partanen@enervent.fi>
Mon 2014-03-17 00:01:38: --> 250 <benita.partaneen@enervent.fi>, Recipient ok

Mon 2014-03-17 00:01:39: <-- MAIL FROM:<test@attraccs.com>
Mon 2014-03-17 00:01:39: noreply@attracs.com is an alias for ThoFager@aholatransportt.fi
Mon 2014-03-17 00:01:39: --> 250 <test@attraccs.com>, Sender ok
Mon 2014-03-17 00:01:39: <-- RCPT TO:<tiina.pitkahjarvi@enervent.fi>
Mon 2014-03-17 00:01:39: --> 250 <tiina.pitkajarvi@enervent.fi>, Recipient ok
Mon 2014-03-17 00:01:39: <-- RCPT TO:<benita.partanen@enervent.fi>
Mon 2014-03-17 00:01:39: --> 250 <benita.partaneen@enervent.fi>, Recipient ok

Both noreply@attraccs.com and test@attraccs.com may have hundreds of entries in the file.

Can you recommend a simple tool for this on Widnows ?

berocoder
  • 197
  • 2
  • 9

2 Answers2

2
sed -e 's/\(^.*<\)\(.*\)\(>.*$\)/\2/' yourfile.txt | sort |uniq

its unix example, but you can get that utils for Windows command line

sed http://gnuwin32.sourceforge.net/packages/sed.htm

sort and uniq http://gnuwin32.sourceforge.net/packages/coreutils.htm

1

Personally, I'm a fan of PowerGrep from JGSoft (I'm a user, not affiliated). You can choose to group identical matches. You can download a trial, but in my opinion it's well worth the money.

pritaeas
  • 119
  • 5