我试图用 pgbadger 解析一个 PostgreSQL 日志文件。它是一个自定义日志前缀。但是当我尝试解析它时,它总是显示 queryes=0。
样本日志:
'2020-03-07T16:09:43Z UTC [ db=dev user=rdsdb pid=16929 userid=1 xid=7382 ]' LOG: SELECT 1
'2020-03-07T16:09:43Z UTC [ db=dev user=rdsdb pid=16929 userid=1 xid=7383 ]' LOG: SET statement_timeout TO 120000
Pgbadger 日志:
/usr/local/bin/pgbadger -v pglog --prefix "'%t [ db=%d user=%u pid=%p userid=%p xid=%x ]'"
DEBUG: timezone not specified, using 0 seconds
DEBUG: Output 'html' reports will be written to out.html
DEBUG: Autodetected log format 'stderr' from pglog
DEBUG: pgBadger will use log format stderr to parse pglog.
DEBUG: Starting progressbar writer process
DEBUG: Processing log file: pglog
DEBUG: Starting reading file pglog...0 bytes of 205 (0.00%), queries: 0, events: 0
DEBUG: Start parsing postgresql log at offset 0 of file pglog to 205
DEBUG: the log statistics gathering took: 2 wallclock secs ( 0.00 usr + 0.01 sys = 0.01 CPU)
DEBUG: Output 'html' reports will be written to out.html
LOG: Ok, generating html report...
DEBUG: building reports took: 0 wallclock secs ( 0.01 usr + 0.00 sys = 0.01 CPU)
DEBUG: the total execution time took: 2 wallclock secs ( 0.01 usr + 0.01 sys = 0.02 CPU)