Skip to content

Instantly share code, notes, and snippets.

@damaya
Created September 4, 2015 04:05
Show Gist options
  • Select an option

  • Save damaya/0333e39f540ce9ff5d6f to your computer and use it in GitHub Desktop.

Select an option

Save damaya/0333e39f540ce9ff5d6f to your computer and use it in GitHub Desktop.
some sed and vim replace queries
Replace only last ocurrence
:s/.*\zsts server thread txn_id txn_time user hostname ip db tbl idx lock_type lock_mode wait_hold victim query//
Replace with seed
sed 's/ts server thread txn_id txn_time user hostname ip db tbl idx lock_type lock_mode wait_hold victim query/<replacewiththis>/g' newdeadlock.log > changedeadlock.log
@damaya

damaya commented Sep 4, 2015

Copy link
Copy Markdown
Author

perl -pne 's/(.*)ts server thread txn_id txn_time user hostname ip db tbl idx lock_type lock_mode wait_hold victim query/$1/' deadlock.log > newdeadlock.log

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