{"id":13936726,"url":"https://github.com/fpietka/rds-pgbadger","last_synced_at":"2025-04-27T12:31:53.132Z","repository":{"id":57460346,"uuid":"70670768","full_name":"fpietka/rds-pgbadger","owner":"fpietka","description":"Fetch logs from RDS instance, and process them with pgBadger","archived":false,"fork":false,"pushed_at":"2021-10-19T09:28:08.000Z","size":60,"stargazers_count":75,"open_issues_count":4,"forks_count":23,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-10-11T09:16:29.977Z","etag":null,"topics":["postgresql","python","rds"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fpietka.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-12T06:40:59.000Z","updated_at":"2024-03-06T21:58:20.000Z","dependencies_parsed_at":"2022-08-28T13:52:53.493Z","dependency_job_id":null,"html_url":"https://github.com/fpietka/rds-pgbadger","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fpietka%2Frds-pgbadger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fpietka%2Frds-pgbadger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fpietka%2Frds-pgbadger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fpietka%2Frds-pgbadger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fpietka","download_url":"https://codeload.github.com/fpietka/rds-pgbadger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224069394,"owners_count":17250456,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["postgresql","python","rds"],"created_at":"2024-08-07T23:02:56.548Z","updated_at":"2024-11-11T08:14:37.799Z","avatar_url":"https://github.com/fpietka.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":".. image:: https://api.codacy.com/project/badge/Grade/902dd72b33df408b8d1274890cd805db\n   :target: https://www.codacy.com/project/fpietka/rds-pgbadger/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=fpietka/rds-pgbadger\u0026amp;utm_campaign=Badge_Grade_Dashboard\n   :alt: Grade\n.. image:: https://img.shields.io/pypi/v/rdspgbadger.svg\n   :target: https://pypi.python.org/pypi/rdspgbadger\n   :alt: Version\n.. image:: https://img.shields.io/pypi/pyversions/rdspgbadger.svg\n   :target: https://pypi.python.org/pypi/rdspgbadger\n   :alt: Python versions supported\n.. image:: https://img.shields.io/pypi/l/rdspgbadger.svg\n   :target: https://pypi.python.org/pypi/rdspgbadger\n   :alt: License\n\n============\nRDS-pgBadger\n============\n\nFetches RDS log files and analyzes them with pgBadger_.\n\nPrerequisites\n-------------\n\nMake sure your credentials are set in the ``~/.aws/credentials`` file.\nAlso, you can set a region in the ``~/.aws/config`` file, so passing region option to the script is not needed.\nLast but not least, make sure you have ``pgbadger`` installed and reacheable from your ``$PATH``.\n\nParameter group\n---------------\n\nYou will have to configure your database parameter group.\n\nFirst of all, ensure ``log_min_duration_statement`` is set to ``0`` or higher, else you won't have anything to be parsed.\n\nThen you must enable some other parameters to get more information in the logs.\n\n+-----------------------------+-------+\n| Parameter                   | Value |\n+=============================+=======+\n| log_checkpoints             | 1     |\n+-----------------------------+-------+\n| log_connections             | 1     |\n+-----------------------------+-------+\n| log_disconnections          | 1     |\n+-----------------------------+-------+\n| log_lock_waits              | 1     |\n+-----------------------------+-------+\n| log_temp_files              | 0     |\n+-----------------------------+-------+\n| log_autovacuum_min_duration | 0     |\n+-----------------------------+-------+\n\nAlso make sure ``lc_messages`` is either at engine default or set to ``C``.\n\nFor further details, please refer to Dalibo's pgBadger_ documentation.\n\nInstallation\n------------\n\nYou can install it using ``pip``::\n\n $ pip install rdspgbadger\n\nUsage\n-----\n\nTo build a ``pgbadger`` report, just run the following (replacing ``instanceid`` by your instance ID)::\n\n $ rds-pgbadger instanceid\n\nOptions\n-------\n\nOnly the Instance ID is mandatory, but there are also other options you can use:\n\n* -d, --date : by default the script downloads all the available logs. By specifying a date in the format ``YYYY-MM-DD``, you can then download only that day's logs.\n* -r, --region : by default the script use the region specified in your AWS config file. If none, or if you wish to change it, you can use this option to do so.\n* -o, --output : by default the script outputs log files and reports to the ``out`` folder. This option allows you to change it.\n* -n, --no-process : download log file(s), but do not process them with pgBadger.\n* -X, --pgbadger-args : command-line arguments to pass to pgBadger\n* --assume-role : By specifying a role you can use STS to assume a role, which is useful for cross account access with out having to setup the `.config` file. Format ``arn:aws:iam::\u003caccount_id\u003e:\u003crole_name\u003e``\n\nKnown issue\n-----------\n\nIn spite of the great work of askainet_, AWS API seems to be too instable, and sometimes download of big log files can\nfail. In such case retrying a few minutes later seems to work.\n\nsee `pull request 10`_\n\nContribute\n----------\n\nFor any request, feel free to make a pull request or fill an issue on Github_.\n\n.. _pgBadger: http://dalibo.github.io/pgbadger/\n.. _Github: https://github.com/fpietka/rds-pgbadger\n.. _askainet: https://github.com/askainet\n.. _pull request 10: https://github.com/fpietka/rds-pgbadger/pull/10\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffpietka%2Frds-pgbadger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffpietka%2Frds-pgbadger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffpietka%2Frds-pgbadger/lists"}