Skip to content

Instantly share code, notes, and snippets.

@scips
Last active October 12, 2017 13:04
Show Gist options
  • Save scips/f1c6ecffb1caba524eed74a2ede0be66 to your computer and use it in GitHub Desktop.
Save scips/f1c6ecffb1caba524eed74a2ede0be66 to your computer and use it in GitHub Desktop.
print out Sphinx base 64 encoded string from sphinxsearch FATAL dump
# 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