openSUSE / openSUSE/supportutils
Feature Request: Time-Bounded Log Slicing for /var/log/messages and journald (--since / --until)
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 35
- Forks
- 70
- Avg merge
- 5d 16h
- Merged PRs (30d)
- 1
Description
Problem Statement
In customer environments where /var/log/messages is unrotated or when -l (additional rotated logs) is enabled, supportconfig can collect gigabytes of irrelevant historical logs for incidents that occurred within a specific time window (e.g., a single day or specific outage timeframe). Current line-count (-I, VAR_OPTION_MSG_LINE_COUNT) and size limits (-X) rely on tail, which only captures the most recent events and risks missing older incidents on busy hosts.
Proposed Solution (Inspired by hb_report)
Introduce time-window log filtering inspired by hb_report's -f/-t mechanism, built with standard core utilities (date, awk, journalctl):
- CLI / Config Options: Add
--since <time>and--until <time>options (avoiding collisions with existing-f/-tdirectory flags), backed byVAR_OPTION_LOG_FROM_TIMEandVAR_OPTION_LOG_TO_TIMEinsupportconfig.conf. - Zero-Dependency Normalization: Use GNU
date -dto parse human relative dates ("yesterday","2 hours ago") and absolute ISO timestamps into Epoch seconds and ISO-8601 strings. - High-Performance Syslog Engine: A single-pass
awkstream filter that processes both RFC 5424 ISO and legacy BSD timestamps while preserving multi-line stack traces without high memory overhead. - Rotated Logs Optimization: Filter
messages-*.xzarchives by file timestamp before streaming viaxzcat | awk, avoiding local disk decompression bloat. - Full SLES 12 LTSS to SLES 16 Compatibility: Strictly uses Bash 4.3+, GNU Coreutils, and Awk available across all SLES releases (including SLES 12 SP5 LTSS).
Full Architecture & Implementation Plan
A detailed architectural feasibility study, component breakdown, and phased implementation roadmap is documented here:
https://docs.google.com/document/d/1gPazSN8t-SgPQo41dJqDkFYPev2haJrGd1egyuLiPnI/edit
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked architectural feasibility study, then trace supportconfig's CLI option handling and supportconfig.conf, including the existing -I, -X, -f and -t options. Review how /var/log/messages, rotated messages-*.xz archives, and journald are currently collected; done means the proposed --since/--until behavior works within the stated SLES compatibility targets.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- awk, bash, shell
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100