Skip to content

Instantly share code, notes, and snippets.

@sbddesign
Created June 27, 2019 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sbddesign/9b60ec5ff33d0d0e139009611358785f to your computer and use it in GitHub Desktop.
Save sbddesign/9b60ec5ff33d0d0e139009611358785f to your computer and use it in GitHub Desktop.
This regular expression is for converting lines of Apache log files into CSV (Comma Separated Values).

Apache Log to CSV

This regular expression is for converting lines of Apache log files into CSV (Comma Separated Values).

Find

^(\d+.\d+.\d+.\d+) - - (\[.+\]) "(.+) (.+) (H.+)" (\d{3}) (\d+) (".+") (".+")$

Replace

$1, $2, $3, $4, $5, $6, $7, $8, $9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment