forked from pool/pgbadger
28423a5bac
Move the cron and systemd files out into the documentation directory and include an extended README.SUSE to show how to work with them. - update to 12.3 This is a maintenance release of pgBadger that fixes issues reported by users since last release. It also adds some new features: * Add option --include-pid to only report events related to a session pid (%p). Can be used multiple time. Thanks to Henrietta Dombrovskaya for the feature request. * Add option --include-session to only report events related to the session id (%c). Can be used multiple time. Thanks to Henrietta Dombrovskaya for the feature request. * Add option --dump-raw-csv to only parse the log and dump the information into CSV format. No further processing is done, no report is generated. Thanks to Henrietta Dombrovskaya for the feature request. Here is the complete list of changes and acknowledgments: * Update pgFormatter to version 5.5 * Fix end date of parsing with jsonlog format. Thanks to jw1u1 for the report. * Fix typo in "Sessions per application". Thanks to fairyfar for the patch. * Fix "INSERT/UPDATE/DELETE Traffic" chart bug. Thanks to fairyfar for the patch. * Fix parsing of orphan lines with bind queries. Thanks to youxq for the report. * Fix Analyze per table report with new PG versions. Thanks to Jean-Christophe Arnu for the patch. * Fix syslog entry parser when the syslog timestamp contains milliseconds. Thanks to Pavel Rabel for the report. - add systemd timer examples: beside the existing cron job example, this allows people to get an idea how to automate the generation of reports - introduce local cron macro: only recommend cron on older distributions and leave the cron example file where it was historically (but place it into the examples folder on newer distributions). - get rid of old suse_version 11.3 check OBS-URL: https://build.opensuse.org/request/show/1130189 OBS-URL: https://build.opensuse.org/package/show/server:database:postgresql/pgbadger?expand=0&rev=4
31 lines
1.2 KiB
Plaintext
31 lines
1.2 KiB
Plaintext
#
|
|
# The following example will auto-generate an incremental report from a
|
|
# postgresql log file, which is rotated on a daily base,
|
|
# every day at 04:00.
|
|
#
|
|
# You need the following settings in a standard postgresql-server
|
|
# installation in /var/lib/pgsql/data/postgresql.conf for this:
|
|
# log_directory = '/var/log/pgsql'
|
|
# log_filename = 'postgresql-%Y-%m-%d.log'
|
|
# log_file_mode = 0640
|
|
# log_rotation_age = 1d
|
|
# log_rotation_size = 0
|
|
#
|
|
# Once you created a new user pgbadger, you can place the script below
|
|
# /etc/cron.d/
|
|
# Please have a look at /usr/share/doc/packages/pgbadger/README.SUSE
|
|
# for setup details.
|
|
#
|
|
# The output will be placed below /srv/www/htdocs/pgbadger/
|
|
#
|
|
# See https://github.com/darold/pgbadger/ for more details
|
|
#
|
|
#-0 4 * * * pgbadger /usr/bin/pgbadger -I -q /var/log/pgsql/postgresql-$(date "+%Y-%m-%d" -d "yesterday").log -O /srv/www/htdocs/pgbadger/
|
|
|
|
|
|
#
|
|
# The following example will generate a report every week using incremental behavior
|
|
#
|
|
#-0 4 * * 1 pgbadger /usr/bin/pgbadger -q `find /var/log/pgsql/ -mtime -7 -name "postgresql.log*"` -o /srv/www/htdocs/pgbadger/reports/pg_errors-`date +\%F`.html -l /srv/www/htdocs/pgbadger/reports/pgbadger_incremental_file.dat
|
|
|