{"id":28556456,"url":"https://github.com/kmoppel/pgweasel","last_synced_at":"2025-07-06T17:31:02.333Z","repository":{"id":297638042,"uuid":"975378731","full_name":"kmoppel/pgweasel","owner":"kmoppel","description":"Simple PostgreSQL log parser CLI","archived":false,"fork":false,"pushed_at":"2025-07-04T12:28:52.000Z","size":715,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-04T14:07:08.841Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"postgresql","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kmoppel.png","metadata":{"files":{"readme":"README.md","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-30T08:09:26.000Z","updated_at":"2025-07-04T12:28:55.000Z","dependencies_parsed_at":"2025-06-06T15:40:37.444Z","dependency_job_id":null,"html_url":"https://github.com/kmoppel/pgweasel","commit_stats":null,"previous_names":["kmoppel/pgweasel"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kmoppel/pgweasel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kmoppel%2Fpgweasel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kmoppel%2Fpgweasel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kmoppel%2Fpgweasel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kmoppel%2Fpgweasel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kmoppel","download_url":"https://codeload.github.com/kmoppel/pgweasel/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kmoppel%2Fpgweasel/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263942178,"owners_count":23533331,"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":[],"created_at":"2025-06-10T06:30:37.790Z","updated_at":"2025-07-06T17:31:02.327Z","avatar_url":"https://github.com/kmoppel.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pgweasel\n\nA simple CLI / interactive use oriented PostgreSQL log parser, to complement [pgBadger](https://github.com/darold/pgbadger).\n\npgweasel tries to:\n\n* be way faster than pgBadger (~10x)\n* way simpler, with less flags and operation modes - concentrating on the Pareto DBA flow\n* focus on CLI interactions - no html / json\n* more cloud-friendly - no deps, a single binary\n* zero config - not dependent on Postgres `log_line_prefix`\n* be more user-friendly - handle relative time inputs, auto-detect the latest log file location if not, subcommand short aliases\n\n\n# Operating modes\n\n`pgweasel errors $LOGFILE(S)_OR_FOLDER` - Show WARN+ log entries \"as is\"\n\n`pgweasel errors --from 10m $LOG` - Show WARN+ log entries from last 10min\n\n`pgweasel errors top $LOG` - Show the most frequent error messages with counts\n\n`pgweasel errors --hist $LOG` - Show a basic vertical histogram of error counts. Default --bucket=1h\n\n`pgweasel errors --hist -l debug5 $LOG` - Show a histogram for all events, not only errors\n\n`pgweasel locks $LOG` - Only show locking (incl. deadlocks, recovery conflicts) entries\n\n`pgweasel peaks $LOG` - Show the \"busiest\" time periods with most log events, using a 10min bucket by default\n\n`pgweasel slow 1s $LOG` - Show queries taking longer than give threshold\n\n`pgweasel slow top $LOG` - Show top 10 (by default) slowest queries\n\n`pgweasel stats $LOG` - Summary of log events - counts / frequency of errors, connections, checkpoints, autovacuums\n\n`pgweasel system $LOG` - Show instance lifecycle events only, i.e. Postgres internal processes, replication, extensions\n\n\n# Quickstart\n\n```\ngit clone https://github.com/kmoppel/pgweasel.git\n\ncd pgweasel \u0026\u0026 go build\n\n./pgweasel -h\n\nA simplistic PostgreSQL log parser for the console\n\nUsage:\n  pgweasel [command]\n\nAvailable Commands:\n  completion  Generate the autocompletion script for the specified shell\n  errors      Shows WARNING and higher entries by default\n  help        Help about any command\n  locks       Only show locking related entries\n  peaks       Identify periods where most log entries are emitted, per severity level\n  slow        Show queries above user set threshold, e.g.: pgweasel slow 1s mylogfile.log\n  stats       Summary of log events\n  system      Show messages by Postgres internal processes\n\nFlags:\n      --csv                  Specify that input file or stdin is actually CSV regardless of file extension\n  -f, --filter stringArray   Add extra line match conditions (regex)\n      --from string          Log entries from $time, e.g.: -1h\n  -h, --help                 help for pgweasel\n  -1, --oneline              Compact multiline entries\n      --peaks                Show only event counts per log level for peak load periods\n      --regex string         Use a custom regex instead of: (default \"(?s)^(?\u003csyslog\u003e[A-Za-z]{3} [0-9]{1,2} [0-9:]{6,} .*?: \\\\[[0-9\\\\-]+\\\\] )?(?P\u003clog_time\u003e[\\\\d\\\\-:\\\\. ]{19,23} [A-Z0-9\\\\-\\\\+]{2,5}|[0-9\\\\.]{14})[\\\\s:\\\\-].*?[\\\\s:\\\\-]?(?P\u003cerror_severity\u003e[A-Z12345]{3,12}):\\\\s*(?P\u003cmessage\u003e(?s:.*))$\")\n      --to string            Log entries up to $time\n  -v, --verbose              More chat\n\nUse \"pgweasel [command] --help\" for more information about a command.\n```\n\n\n# Contributing\n\nAll kinds of feedback and help would be much appreciated - especially as I'm not a developer per se. Hopefully pgweasel will grow into a community project with rock solid quality.\n\n\n# TODO\n\n* jsonlog support\n* goreleaser support\n* more test \u0026 refactoring\n* temp files mode\n* perf optimizations, no effort so far\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkmoppel%2Fpgweasel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkmoppel%2Fpgweasel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkmoppel%2Fpgweasel/lists"}