Skip to content

Instantly share code, notes, and snippets.

@dcode
Last active August 29, 2015 14:23
Show Gist options
  • Save dcode/1ae484ad65ad319cbee6 to your computer and use it in GitHub Desktop.
Save dcode/1ae484ad65ad319cbee6 to your computer and use it in GitHub Desktop.
bro / jq wizardry in the shell
(cat files.log | grep EXTRACT | jbro | jq --slurp 'sort_by(.missing_bytes) | .[].conn_uids ' | jq --slurp 'flatten | unique | join("|") ' > /tmp/side.fifo & ); while read line </tmp/side.fifo; do cat conn.log | grep -E $line; break; done;
grep -E $(cat files.log | grep EXTRACT | jbro | jq --slurp 'sort_by(.missing_bytes) | .[].conn_uids ' | jq --slurp 'flatten | unique | join("|") ') conn.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment