openSUSE / openSUSE/supportutils

Feature Request: Time-Bounded Log Slicing for /var/log/messages and journald (--since / --until)

Open
#308 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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):

  1. CLI / Config Options: Add --since <time> and --until <time> options (avoiding collisions with existing -f / -t directory flags), backed by VAR_OPTION_LOG_FROM_TIME and VAR_OPTION_LOG_TO_TIME in supportconfig.conf.
  2. Zero-Dependency Normalization: Use GNU date -d to parse human relative dates ("yesterday", "2 hours ago") and absolute ISO timestamps into Epoch seconds and ISO-8601 strings.
  3. High-Performance Syslog Engine: A single-pass awk stream filter that processes both RFC 5424 ISO and legacy BSD timestamps while preserving multi-line stack traces without high memory overhead.
  4. Rotated Logs Optimization: Filter messages-*.xz archives by file timestamp before streaming via xzcat | awk, avoiding local disk decompression bloat.
  5. 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.