Skip to content

Instantly share code, notes, and snippets.

@carld
Created June 4, 2015 06:33
Show Gist options
  • Save carld/c17750c9eec4cb9215c0 to your computer and use it in GitHub Desktop.
Save carld/c17750c9eec4cb9215c0 to your computer and use it in GitHub Desktop.
sed regex to parse apache combined log
cat access.log | sed 's/^\([0-9\.]\+\) \([^ ]\+\) \([^ ]\+\) \[\(.*\)\] \("[^"]*"\) \([^ ]*\) \([^ ]*\) \("[^"]*"\) \("[^"]*"\).*/"\1"\t"\2"\t"\3"\t"\4"\t\5\t"\6"\t"\7"\t\8\t\9/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment