Skip to content

Instantly share code, notes, and snippets.

@alexbevi
Last active January 17, 2020 20:32
Show Gist options
  • Save alexbevi/f05d4bbaacddb78bd1068ae5bc64ac25 to your computer and use it in GitHub Desktop.
Save alexbevi/f05d4bbaacddb78bd1068ae5bc64ac25 to your computer and use it in GitHub Desktop.

This script uses bsondump (twice), jq (twice) and ruby

bsondump --quiet metrics.2019-12-22T17-34-22Z-00000 | jq -s '.[] | select( .type | ."$numberInt" == "1")' | jq -s 'first | .data ."$binary" .base64' -Mc | ruby -rzlib -rbase64 -e 'd = STDIN.read; print Zlib::Inflate.new.inflate(Base64.decode64(d)[4..-1])' | bsondump --quiet | jq | less
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment