Skip to content

Instantly share code, notes, and snippets.

@vwbusguy
Created April 9, 2018 14:37
Show Gist options
  • Save vwbusguy/548eea3d2cebe3f1d556658e4574ff38 to your computer and use it in GitHub Desktop.
Save vwbusguy/548eea3d2cebe3f1d556658e4574ff38 to your computer and use it in GitHub Desktop.
Example Regex for parsing OpenLdap logs (Ruby flavor - works for FluentD)
/^(?<time>\w{3}\s+\d \d{1,2}:\d{1,2}:\d{1,2}) (?<host>[\w\-\d]+) (?<process>\w+)\[(?<pid>\d+)\]\: ((conn=(?<conn>\d+) (fd=(?<fd>\d+))?(op=(?<op>\d+))?)?\s?(?<message>.*))$/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment