The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Locate activity by subject with Exim

Discussion in 'E-mail Discussions' started by khalled, Jan 8, 2015.

  1. khalled

    khalled Active Member

    Joined:
    Jan 8, 2011
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    6
    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
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  3. khalled

    khalled Active Member

    Joined:
    Jan 8, 2011
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    6
    very thanks
     
Loading...

Share This Page