Skip to content

Instantly share code, notes, and snippets.

@reimai
Created April 13, 2016 08:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reimai/cb9c1c5915607a91dca4fb957c690e7e to your computer and use it in GitHub Desktop.
Save reimai/cb9c1c5915607a91dca4fb957c690e7e to your computer and use it in GitHub Desktop.
parse fix quote events messages out of tcp dump to compare receiving and sending time
#!/bin/bash
#turn tcp dump into a text file:
# receiving_time -> fix_msg_sending_time
tcpdump -A -r - | strings | sed 's/\.\([[:digit:]]\+=\)/|\1/g' | sed 's/\.*$//g' | sed 's/^[^|]*|/|/g' | grep 'length\|8=FIX' | grep -B 1 '35=X' | grep -v '^--$' | cut -d ' ' -f 1 | sed 's/.*52=\([^|]*\).*/-> \1/g' | paste - -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment