Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.