Skip to content

Instantly share code, notes, and snippets.

@chux0519
Last active October 22, 2018 09:42
Show Gist options
  • Save chux0519/09b0e38712e2b15f0a129cce9a15fa88 to your computer and use it in GitHub Desktop.
Save chux0519/09b0e38712e2b15f0a129cce9a15fa88 to your computer and use it in GitHub Desktop.
mongodb-log-sed.sh
sed -n '/protocol:op_query/p' mongod.log | sed 's/\([0-9|_|T]*\+0000\) .*command \(.*\..*\) command:.*planSummary: \([A-Z|_]*\) .*protocol:op_query \([0-9]*ms\)$/\1 \2 \3 \4/g'
git log -1 --pretty=%B | tr "\n" " " | tr "\t" " " | sed s/[[:space:]]//g
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment