0

From postfix's logfile I can grep all the lines that indicate the delivery of one message:

Jan  3 15:28:21 mail postfix/pipe[1040]: [...] status=sent
Jan  3 15:28:21 mail postfix/pipe[1157]: [...] status=sent
Jan  3 15:28:22 mail postfix/pipe[980]: [...] status=sent

I'd like to group them together by timestamp, so I can calculate the messages per second for a given time range. How can I do that?

AndreKR
  • 551
  • 1
  • 3
  • 17

1 Answers1

2

This should do it:

$ cut -d " " -f 4 postfix.log  | sort -n | uniq -c

If you want to select a given time range, just throw another grep before this with your desired regex.

EEAA
  • 109,363
  • 18
  • 175
  • 245