There’s two non-obvious things to know when starting to use pgbadger with AWS RDS.
log_statement = None
Don’t set this to all as the AWS docs suggest.
Further, don’t waste your time trying to add a DB parameter to set
log_line_prefix to pgbadger’s recommended value: it’s not possible1.
Instead tell pgbadger about the log format that RDS insists on:
pgbadger -f stderr -p '%t:%r:%u@%d:[%p]:' postgres.log
Hope that saves you some time. Note that the
-f stderr is required for
pgbadger v10 and above2: