Locate activity by subject with Exim
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
[/PHP]
what if i want run this command to give me feedback for only the last day or last two days
-
Hello :) The "tail" command may help. EX: 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.0 -
very thanks 0
Please sign in to leave a comment.
Comments
2 comments