<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif">journalctl can help you with that, e.g if you use postfix for MTA<br></div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif"><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)"># journalctl <span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">--no-hostname</span> </span>-o short-iso --since -24h -u postfix</span><br></span></div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif"><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">2022-01-17T03:19:14+0000 postfix/pickup[932305]: D8D2E40FFC: uid=0 from=<root>
</span><br>2022-01-17T03:19:14+0000 postfix/cleanup[932955]: D8D2E40FFC: message-id=<20220117031914.D8D2E40FFC@mail.local>
<br>2022-01-17T03:19:14+0000 postfix/qmgr[1458]: D8D2E40FFC: from=<root@mail.local>, size=2916, nrcpt=1 (queue active)
<br>2022-01-17T03:19:14+0000 postfix/local[932957]: D8D2E40FFC: to=<root@mail.local>, orig_to=<root>, relay=local, delay=0.09, delays=0.07/0.02/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
<br>2022-01-17T03:19:14+0000 postfix/qmgr[1458]: D8D2E40FFC: removed<br>
</span></div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br clear="all"></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><span style="font-family:tahoma,sans-serif">--<br>Rabin</span></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 17 Jan 2022 at 10:59, אורי <<a href="mailto:uri@speedy.net">uri@speedy.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I want to check mail.log for how many emails are sent every day. The format of my mail.log is something like this:</div><div><br></div><div>Jan 17 08:49:23 www .... (the rest of the log)</div><div><br></div><div>I'm running a command such as:</div><div><br></div><div>cat mail.log* |fgrep "status=sent (250 Ok"|awk '{print $1" "$2}'|sort -n|uniq -c</div><div><br></div><div>And I receive the number of emails sent every day. But the date doesn't contain the year, the months are sorted alphabetically and the line of Jan 17 comes before the line of Jan 2. I would like to sort the lines according to the date order such as in yyyy-mm-dd and with including the year. How do I do it?</div><div><br clear="all"><div><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div style="direction:rtl"><div style="direction:rtl">אורי</div><div style="direction:rtl"><a href="mailto:uri@speedy.net" target="_blank">uri@speedy.net</a></div></div></div></div></div></div></div></div></div>
_______________________________________________<br>
Linux-il mailing list<br>
<a href="mailto:Linux-il@cs.huji.ac.il" target="_blank">Linux-il@cs.huji.ac.il</a><br>
<a href="http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il" rel="noreferrer" target="_blank">http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il</a><br>
</blockquote></div>