Last active
October 12, 2017 13:04
-
-
Save scips/f1c6ecffb1caba524eed74a2ede0be66 to your computer and use it in GitHub Desktop.
print out Sphinx base 64 encoded string from sphinxsearch FATAL dump
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage Get base64 decoded from dump: cat searchd.* | awk -f crash.awk | base64 -d | |
# Usage Get specific term that caused the crash: cat searchd.* | awk -f crash.awk | base64 -d | awk 'match($0, /.*\^(\w+)\$.*/, a) {print a[1]}' | sort | uniq -c | |
BEGIN { RS=""; FS="\n" } | |
{ | |
keep=0 | |
for(i=1;i<=NF;i++) { | |
if ( $i ~ /request dump end/ ) { | |
keep=0 | |
print temp | |
temp="" | |
} else { | |
if ( $i ~ /crashed SphinxAPI request dump/ ) keep=1 | |
else { | |
if (keep == 1) temp=temp $i | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment