-
-
Notifications
You must be signed in to change notification settings - Fork 128
pgbadger
Graham Christensen edited this page Jan 16, 2022
·
6 revisions
Assuming your local machine is on the wireguard network...
On haumea, run:
socat -u SYSTEM:'journalctl --output=short-iso -u postgresql | zstd -9 | pv' TCP4-LISTEN:10050,so-bindtodevice=wg0,reuseaddr
On your local machine, run:
pgbadger --journalctl 'xfer() { nc -N 10.254.1.9 10050 < /dev/null | zstd -d; }; xfer' --prefix "%t\+\d+ .*[%p]: user=%u,db=%d,app=%a,client=%h "
Note the bizarre --journalctl argument is to deal with pgbadger passing --output=short-iso to the command. If it isn't working correctly, try removing the xfer() { ... }; xfer wrapper and see what arguments it is passing.