Skip to content

Instantly share code, notes, and snippets.

@beef
Created September 7, 2009 11:44
Show Gist options
  • Save beef/182315 to your computer and use it in GitHub Desktop.
Save beef/182315 to your computer and use it in GitHub Desktop.
Regular expression to find log blocks for certain actions
#!/bin/bash
# using all types of newlines, search for a rails log header for a certain action of a certain controller
# copy and paste into terminal
pcregrep -MN ANY 'Processing FatController#action_man([^\n]*\n){10}' log/production.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment