forked from darold/pgbadger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
executable file
·80 lines (56 loc) · 2.84 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
DESCRIPTION:
------------
PgBadger - An other PostgreSQL log analyzer that aims to replace and
outperforms pgFouine
This is still a work in progress.
PREREQUISITE:
-------------
You must first enable SQL query logging to have something to parse:
log_min_duration_statement = 0
With 'stderr' log format, log line prefix must be at least:
log_line_prefix = '%t [%p]: [%l-1] '
Log line prefix could add user and database name as follow:
log_line_prefix = '%t [%p]: [%l-1] user=%u,db=%d '
or for syslog log file format:
log_line_prefix = 'user=%u,db=%d '
Log line prefix for stderr output could also be:
log_line_prefix = '%t [%p]: [%l-1] db=%d,user=%u '
or for syslog output:
log_line_prefix = 'db=%d,user=%u '
Additional informations that could be collected need logging activation into postgresql.conf:
log_checkpoints = on
log_connections = on
log_disconnections = on
log_lock_waits = on
log_temp_files = 0
USAGE:
------
pgbadger -l logfile [...]
-l | --logfile filename: path to the PostgreSQL log file to parse. It can
be a plain text log or a gzip compressed file
with the .gz extension.
-f | --format logtype : the value can be: syslog or stderr. Default: stderr
-o | --outfile filename: define the filename for the output. Default depends
of the output format: out.html or out.txt. To dump
output to stdout use - as filename.
-i | --ident name : programname used as syslog ident. Default: postgres
-h | --help : show this message and exit.
-d | --dbname database : only report what concern the given database
-u | --dbuser username : only report what concern the given user
-t | --top number : number of query to store/display. Default: 20
-s | --sample number : number of query sample to store/display. Default: 3
-x | --extension : output format. Values: text or html. Default: html
-m | --maxlength size : maximum length of a query, it will be cutted above
the given size. Default: no truncate
-g | --graph : generate graphs, requires GD::Graph perl module
-b | --begin datetime : start date/time for the data to be parsed in log.
Format: -b "yyyy-mm-dd hh:mm:ss"
-e | --end datetime : end date/time for the data to be parsed in log.
Format: -e "yyyy-mm-dd hh:mm:ss"
-q | --quiet : disable output to stderr and don't print debug informations.
-p | --progress : show a progress bar, quiet mode is enabled with this option.
-v | --version : show current version
--pie-limit num : do not show pie data lower that num%, show a sum of them instead.
AUTHORS:
--------
Gilles Darold <[email protected]>