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 ?

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.