Rather than using
date | awk ..., you can use a format specifier with the date command for the format you want. According to the
date(1) man page,
%b is the abbreviated month name, and
%e is the day of month, space padded, same as
The following date command should give you a string in the form you want:
date "+%b %e"
You can also put other characters into the format specifier, so if you use:
date "+^%b %e"
you'll get a grep pattern that matches the date only at the beginning of the line. This would prevent any false matches where there is a date in the message part of the log.
As pointed out by Steven D, you can also do this with a single invocation of
grep -E "$(date '+^%b %e')"'.*(BREAK-IN|Invalid|user|Failed|refused|su|Illegal)' /var/log/auth.log
I've made a few changes based on issues mentioned in comments related to quoting. My rules for quoting are to use single quotes when grouping separate words into a single word and to protect against shell expansion of metacharacters, and to use double quotes only when you want to expansion inside a multi-word string.
The original answer had the
date format string in double quotes, which was wrong according to my above rules. I've now changed that. An edit put the grep string into double quotes. I've put it back into single quotes because there is so often an overlap between shell metacharacters and grep regular expression (RE) metacharacters that you almost always want to single-quote REs to grep. The current string may not need single quotes but if this shell function evolves over time, it may break with future changes.
Because the question was asking about a command to put inside an alias, there was an additional level of quoting that was not shown in this answer. It would be simpler to use a shell function instead of an alias so you don't need to deal with this extra level of quoting. Nested quoting can get messy quickly, so anything you can do to avoid it, you should do.
I have tested this as a shell function, using Gilles suggestion for futzing the date and it "works for me".