Skip to content

Instantly share code, notes, and snippets.

@Splat
Created September 22, 2016 23:59
Show Gist options
  • Save Splat/76ceda72be6c6c8da2466773c6c4433b to your computer and use it in GitHub Desktop.
Save Splat/76ceda72be6c6c8da2466773c6c4433b to your computer and use it in GitHub Desktop.
Working with the mongodb oplog for non indexed queries
cd /var/log/mongodb/
grep '2015-07-10' mongodb.log| grep IXSCAN | sed -e s'/.*planSummary: IXSCAN//' | sed -e 's/ cursorid.*//; s/ keyUpdates.*//; s/ nto.*//; ' | perl -lne 'print join "\n", split /, IXSCAN/;' | perl -pne 's/(^\s+)//' | sort | uniq -c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment