Skip to content

Instantly share code, notes, and snippets.

@gtd
Created November 20, 2013 10:38
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 gtd/7561067 to your computer and use it in GitHub Desktop.
Save gtd/7561067 to your computer and use it in GitHub Desktop.
Extract Default Rails Log Request Entries
awk '
/^Started .+ "\/services\/samsung/ {printf("\n");flag=1}
flag {print}
/^Completed /{flag=0}
' production.log
cat production.log | awk '
/^Started PUT "\/staged\/films\/.*\/still"/ {printf("\n");flag=1}
flag {print}
/^ User ID: /{flag=0}
' >> ~/still_edits.log
zcat production.log-20140208.gz production.log-20140207.gz | awk '
/^Started PUT "\/staged\/films\/.*\/still"/ {printf("\n");flag=1}
flag {print}
/^ User ID: /{flag=0}
' >> ~/still_edits.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment