Locate activity by subject with Exim

khalled

Active Member
Jan 8, 2011
34
0
56
we run the following command to locate duplicate subjects from Exim mail log

PHP:
awk -F"T=\"" '/<=/ {print $2}' /var/log/exim_mainlog | cut -d\" -f1 | sort | uniq -c | sort -n
what if i want run this command to give me feedback for only the last day or last two days
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
Hello :)

The "tail" command may help. EX:

Code:
tail -2000 /var/log/exim_mainlog | awk -F"T=\"" '/<=/ {print $2}' | cut -d\" -f1 | sort | uniq -c | sort -n
Simply change "2000" to the value of your preference. It's not by date, but selecting a specific number of lines will reduce the amount of information that's checked. Otherwise, Google search results show several methods of filtering awk output with dates/times.

Thank you.