fpietka / rds-pgbadger Goto Github PK
View Code? Open in Web Editor NEWFetch logs from RDS instance, and process them with pgBadger
License: MIT License
Fetch logs from RDS instance, and process them with pgBadger
License: MIT License
2019-07-24 07:35:05,150 :: INFO :: Getting logs from 2019-07-23
2019-07-24 07:35:05,352 :: INFO :: Downloading file /home/postgres/logs/vendor-live//error/postgresql.log.2019-07-23-00
2019-07-24 07:35:05,996 :: INFO :: Log truncated, retrying portion with NumberOfLines = 948
2019-07-24 07:35:08,924 :: INFO :: Log truncated, retrying portion with NumberOfLines = 852
2019-07-24 07:36:25,812 :: ERROR :: An error occurred (Throttling) when calling the DownloadDBLogFilePortion operation (reached max retries: 4): Rate exceeded
Hi,
I getting this error with my logs
2018-11-30 15:44:55,663 :: INFO :: Downloading file postgres_logs/error/postgresql.log.2018-11-30-00
2018-11-30 15:44:55,735 :: INFO :: Downloading file postgres_logs/error/postgresql.log.2018-11-30-01
2018-11-30 15:44:55,825 :: INFO :: Downloading file postgres_logs/error/postgresql.log.2018-11-30-02
2018-11-30 15:44:55,967 :: INFO :: Log truncated, retrying portion with NumberOfLines = 76
2018-11-30 15:44:56,146 :: INFO :: Log truncated, retrying portion with NumberOfLines = 1
2018-11-30 14:51:08,971 :: ERROR :: An error occurred (Throttling) when calling the DownloadDBLogFilePortion operation (reached max retries: 4): Rate exceeded
I generate up to 35GB of logs daily, each chunk with about 2~3GB
Running the program with -n
should not require pgBadger. The program fails with an error message saying pgBadger was not found.
I am running command "rds-pgbadger my-db-instance" but getting following exception-
016-11-04 08:29:36,529 :: INFO :: Getting all logs
Traceback (most recent call last):
File "/usr/local/bin/rds-pgbadger", line 9, in <module>
load_entry_point('rdspgbadger==1.0.2', 'console_scripts', 'rds-pgbadger')()
File "/Library/Python/2.7/site-packages/package/rdspgbadger.py", line 117, in main
get_all_logs(args.instance, args.output, args.date, args.region)
File "/Library/Python/2.7/site-packages/package/rdspgbadger.py", line 84, in get_all_logs
for log in (name for name in response.get("DescribeDBLogFiles")
File "/Library/Python/2.7/site-packages/package/rdspgbadger.py", line 85, in <genexpr>
if date in name["LogFileName"]):
TypeError: 'in <string>' requires string as left operand, not NoneType
It would seem that the error is due to missing region but my ~/.aws/config
looks like this-
[default]
region = us-east-1
output = json
Python version -
Python 2.7.10 (default, Jul 30 2016, 18:31:42)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Hi,
Just wanted to ask how you got around the 1mb limit on the log file downloads?
Thanks
When trying to pull down the logs I get stuck in a retry loop
2019-04-08 10:10:03,806 :: INFO :: Downloading file out/error/postgresql.log.2019-04-05-18 2019-04-08 10:10:05,883 :: INFO :: Log truncated, retrying portion with NumberOfLines = 2864 2019-04-08 10:10:08,441 :: INFO :: Log truncated, retrying portion with NumberOfLines = 2838 2019-04-08 10:10:10,727 :: INFO :: Log truncated, retrying portion with NumberOfLines = 2633 2019-04-08 10:10:12,855 :: INFO :: Log truncated, retrying portion with NumberOfLines = 2528 2019-04-08 10:10:14,608 :: INFO :: Log truncated, retrying portion with NumberOfLines = 1528 2019-04-08 10:10:42,787 :: INFO :: Log truncated, retrying portion with NumberOfLines = 776 2019-04-08 10:10:49,459 :: INFO :: Log truncated, retrying portion with NumberOfLines = 511 2019-04-08 10:10:51,049 :: INFO :: Log truncated, retrying portion with NumberOfLines = 1 2019-04-08 10:10:52,547 :: INFO :: Log truncated, retrying portion with NumberOfLines = 1 2019-04-08 10:10:53,443 :: INFO :: Log truncated, retrying portion with NumberOfLines = 1 2019-04-08 10:10:54,233 :: INFO :: Log truncated, retrying portion with NumberOfLines = 1 2019-04-08 10:10:55,068 :: INFO :: Log truncated, retrying portion with NumberOfLines = 1 2019-04-08 10:10:56,016 :: INFO :: Log truncated, retrying portion with NumberOfLines = 1 2019-04-08 10:10:57,281 :: INFO :: Log truncated, retrying portion with NumberOfLines = 1 .... <snip> 2019-04-08 10:34:36,407 :: INFO :: Log truncated, retrying portion with NumberOfLines = 1 2019-04-08 10:34:37,384 :: INFO :: Log truncated, retrying portion with NumberOfLines = 1
and so on till I break out meaning it doesn't run pgbadger.
Is there another setting I should have on my logging side or something to do on the download side?
Thanks
I'd like to be able to pass extra command-line arguments to pgbadger.
And example would be something like:
rds-pgbadger my_instance -r us-east-1 --pgbadger-args '--exclude-query "^(VACUUM|COMMIT)" --top 30'
Thoughts? I'm more than happy to create a pull request if this is something you'd be interested in merging.
Then I try to download a large file more that 300MB - I got truncated file in error folder.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.