Skip to content

Instantly share code, notes, and snippets.

@beneshed
Last active May 23, 2019 10:54
Show Gist options
  • Save beneshed/628160ee08c6f99f376ce89967ffa1ef to your computer and use it in GitHub Desktop.
Save beneshed/628160ee08c6f99f376ce89967ffa1ef to your computer and use it in GitHub Desktop.
Regex for auth.log
# generic
([A-Za-z]+)\s(\d+)\s((\d+):(\d+):(\d+))\s([A-Za-z0-9-]+)\s([A-Z-]+(\[[0-9]+\])?:)\s(.*)
# command specific
([A-Za-z]+)\s(\d+)\s((\d+):(\d+):(\d+))\s([A-Za-z0-9-]+)\s([A-Z-]+(\[[0-9]+\])?:)\s+(\w+)\s+:\s+TTY=([0-9A-Z\/]+\s;)\sPWD=([0-9A-Z\/]+\s;)\sUSER=([0-9A-Z\/]+\s;)\sCOMMAND=(.*)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment