Code Monkey home page Code Monkey logo

pgbadger's Introduction

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.
    -e | --end datetime    : end date/time for the data to be parsed in log.
    -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.
    --pie-limit num        : do not show pie data lower that num%, show a sum of them instead.

AUTHORS:
--------

Gilles Darold <[email protected]>

pgbadger's People

Contributors

darold avatar ireuben avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.