{"id":44949989,"url":"https://github.com/gms1/journalcheck","last_synced_at":"2026-03-15T13:36:32.864Z","repository":{"id":338655087,"uuid":"1158309666","full_name":"gms1/journalcheck","owner":"gms1","description":"audit systemd journal entries with configurable priority filtering, pattern matching, and security violation detection","archived":false,"fork":false,"pushed_at":"2026-03-14T17:18:21.000Z","size":230,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-15T02:15:06.201Z","etag":null,"topics":["admin","audit","journal","journald","logcheck","logging","monitoring","security","systemd"],"latest_commit_sha":null,"homepage":"https://gms1.github.io/journalcheck/","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/gms1.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG-latest.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-15T06:15:01.000Z","updated_at":"2026-03-14T17:14:26.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/gms1/journalcheck","commit_stats":null,"previous_names":["gms1/journalcheck"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/gms1/journalcheck","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gms1%2Fjournalcheck","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gms1%2Fjournalcheck/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gms1%2Fjournalcheck/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gms1%2Fjournalcheck/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gms1","download_url":"https://codeload.github.com/gms1/journalcheck/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gms1%2Fjournalcheck/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30540826,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-15T07:17:37.589Z","status":"ssl_error","status_checked_at":"2026-03-15T07:17:31.738Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["admin","audit","journal","journald","logcheck","logging","monitoring","security","systemd"],"created_at":"2026-02-18T10:08:56.216Z","updated_at":"2026-03-15T13:36:32.859Z","avatar_url":"https://github.com/gms1.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# journalcheck\n\n[![CI](https://github.com/gms1/journalcheck/actions/workflows/ci.yml/badge.svg)](https://github.com/gms1/journalcheck/actions/workflows/ci.yml)\n[![codecov](https://codecov.io/gh/gms1/journalcheck/branch/main/graph/badge.svg)](https://codecov.io/gh/gms1/journalcheck)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/gms1/journalcheck/pulls)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\nSystemd journal monitoring and notification tool with priority filtering, pattern matching and security violation detection.\n\nInspired by [logcheck](https://packages.debian.org/stable/logcheck), but designed for systemd's journal with output that can be piped to other programs for notifications, monitoring, or alerting.\n\n## Key Differences from logcheck\n\n- **Priority-based filtering**: Filter messages by systemd priority levels (emerg, alert, crit, err, warning, notice, info, debug) - logcheck only supports pattern matching\n- **Per-service priority control**: Set different priority thresholds for different services without writing individual ignore patterns\n- **Flexible output**: Pipe to any command, send via email, or output to stdout - not limited to email only\n- **JSON output**: Machine-readable format for integration with monitoring systems\n- **Cursor-based tracking**: Only process new entries since last run using systemd journal cursors\n\n## Features\n\n- Priority-based filtering (emerg, alert, crit, err, warning, notice, info, debug)\n- Per-identifier priority configuration\n- Regex pattern matching for identifiers (case-sensitive; (?i) is supported)\n- Regex pattern matching for ignore and violations patterns (always case-insensitive)\n  - **Ignore patterns**: Must match the entire message (implicit anchors)\n  - **Violation patterns**: Can match anywhere in the message (substring match)\n- Two-level pattern hierarchy:\n  - **Violations**: Always shown (e.g., failed logins, security events)\n  - **Ignore**: Suppress matching messages (exact match)\n- Pre-configured violation patterns for common services (sshd, sudo, su, smartd)\n- Cursor-based tracking (only process new entries)\n- Multiple output formats (short, json)\n- Modular configuration via `/etc/journalcheck.yaml` and `/etc/journalcheck.d/*.yaml`\n\n## Installation\n\n### From PyPI\n\n```bash\npip install journalcheck\n```\n\n### From Debian package\n\nDownload the `.deb` file from the [releases page](https://github.com/gms1/journalcheck/releases) and install:\n\n```bash\nsudo dpkg -i journalcheck_*.deb\n```\n\n### via APT Repository\n\n- download the public key:\n\n```bash\ncurl -fsSL https://gms1.github.io/journalcheck/apt/public.gpg | sudo gpg --dearmor -o /usr/share/keyrings/journalcheck-archive-keyring.gpg\n```\n\n- register the apt repository\n\n```bash\necho \"deb [signed-by=/usr/share/keyrings/journalcheck-archive-keyring.gpg] https://gms1.github.io/journalcheck/apt ./\" | sudo tee /etc/apt/sources.list.d/journalcheck.list\n```\n\n- install this package\n\n```bash\nsudo apt update \u0026\u0026 sudo apt install journalcheck\n```\n\n### From source\n\n```bash\npip install -e .\n```\n\n## Configuration\n\nMain config: `/etc/journalcheck.yaml`\n\nAdditional configs: `/etc/journalcheck.d/*.yaml` (merged automatically)\n\nExample:\n```yaml\npriority: warning\nformat: short\n\n# Optional: pipe output to a command\noutput_command: \"notify-send 'Journal Alert'\"\n\n# Optional: send output via email\nemail_to: \"admin@example.com\"\nemail_subject: \"Journal Alerts\"\n\nidentifiers:\n  ssh: # Exact match\n    priority: info\n    ignore:\n      - \".*session opened.*\"   # Full match: must match entire message\n      - \".*session closed.*\"\n    violations:\n      - \"Failed password\"       # Substring: matches anywhere in message\n  /^(?i)cron$/: # Match both \"cron\" and \"CRON\" using case-insensitive regex\n    priority: notice\n    ignore:\n      - \".*session opened.*\"\n      - \".*session closed.*\"\n  /^.*$/: # Any other identifier\n    violations:\n    - (error|failed)\n```\n\n**Output Options:**\n- If `output_command` is set, output will be piped to that command\n- If `email_to` is set, output will be sent via email using the `mail` command\n- If neither is set, output goes to stdout by (default), except if running as systemd service\n\n## Default Violations\n\nThe following identifiers have pre-configured violation patterns that are automatically included:\n\n- **sshd**: Failed password, Invalid user, Connection closed by authenticating user, etc.\n- **sudo**: authentication failure, user NOT in sudoers, incorrect password attempt\n- **su**: FAILED su, authentication failure\n- **smartd**: SMART Failure, Attribute.*failed, Error.*occurred\n- **kernel**: I/O error, Buffer I/O error, end_request: I/O error\n\nYou can add additional violations to these identifiers - they will be appended to the defaults.\n## Usage\n\n### Basic usage\n```bash\njournalcheck\n```\n\n### Filter output\n```bash\njournalcheck | grep ssh\n```\n\n### Save to file\n```bash\njournalcheck \u003e /var/log/journal-alerts.log\n```\n\n### Send via email\n```bash\njournalcheck | mail -s \"Journal Alerts\" admin@example.com\n```\n\n### Run via systemd timer\nThe package includes systemd service and timer units for automated checking.\n\n**Enable the timer:**\n```bash\nsudo systemctl enable --now journalcheck.timer\n```\n\n**Check timer status:**\n```bash\nsudo systemctl status journalcheck.timer\nsudo systemctl list-timers journalcheck.timer\n```\n\n**Customize the schedule:**\nThe default schedule is hourly. To change it:\n```bash\nsudo systemctl edit journalcheck.timer\n```\n\nAdd your custom schedule:\n```ini\n[Timer]\nOnCalendar=daily\n```\n\nSee `systemd.time(7)` for schedule syntax.\n\n## License\n\nMIT License - see [LICENSE](LICENSE) file for details.\n\n## Repository\n\nhttps://github.com/gms1/journalcheck\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgms1%2Fjournalcheck","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgms1%2Fjournalcheck","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgms1%2Fjournalcheck/lists"}