Skip to content

Instantly share code, notes, and snippets.

@ingmarioalberto
Forked from travishegner/haproxy2apache
Created May 6, 2022 15:44
Show Gist options
  • Save ingmarioalberto/ac170f4d01bcd88037f73ae2b99e62fe to your computer and use it in GitHub Desktop.
Save ingmarioalberto/ac170f4d01bcd88037f73ae2b99e62fe to your computer and use it in GitHub Desktop.
A quick bash one liner to convert haproxy logs to something like apache logs so that logstalgia can read them
ssh USER@IP tail -f /var/log/haproxy-traffic.log | stdbuf -o0 awk '{print $9" "$6" - - "$7" "$18" "$19" "$20" "$11" "$12}' | sed -u "s/:[0-9]\{4,5\}//g" | sed -u "s/\(:[0-6][0-9]\)\.[0-9]\{3\}/\\1 -400/g" | logstalgia --sync --paddle-mode vhost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment