Created
September 1, 2016 22:32
-
-
Save drwilco/43f4b18837ae0c94dc81caecea451bf5 to your computer and use it in GitHub Desktop.
This file contains 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
log=$(cat -) | |
request=$(echo "$log" | grep -E "^ *[0-9]+ TxRequest" | sed -E 's/^ *[0-9]+ TxRequest *b //') | |
url=$(echo "$log" | grep -E "^ *[0-9]+ TxURL" | sed -E 's/^ *[0-9]+ TxURL *b //') | |
headers=$(echo "$log" | grep -E "^ *[0-9]+ TxHeader" | sed -E 's/^ *[0-9]+ TxHeader *b (.*)$/-H "\1"/' | paste -s -d ' ' | sed 's/\!/\\\!/g') | |
read backend lip lport rip rport ssl <<<$(echo "$log" | grep -E "^ *[0-9]+ Backend(Addr|Open)" | sed -E 's/^ *[0-9]+ Backend(Addr|Open) *b //') | |
if [ "$f" = "SSL" ]; then | |
proto="https" | |
else | |
proto="https" | |
fi | |
echo curl -X $request $proto://$rip:$rport$url $headers |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment