oxidecomputer / oxidecomputer/omicron
oxlog: want a way to list N most recent log files
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 572
- Forks
- 97
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 96
Description
When debugging, log rotation may have occurred at some point during the event of interest. In that case, it's often useful to be able to inspect the current log file for a service plus the archived log file immediately prior to the current one. Doing this with oxlog is presently somewhat difficult, because archived log files may exist across multiple datasets, and piping oxlog into sort(1) will not output the log files in chronological order, since they are sorted by the UUID of the dataset before sorting chronologically. This is unfortunate.
It would be nice if oxlog logs --archived had a way to select the N most recent archived logs. That way, a user who wishes to use grep or looker to search for an event in the current and most-recent-archived log files could run something like:
$ oxlog logs <SVC> --current --last 1 | xargs -L 1 cat | looker
or whatever.
Contributor guide
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 at the oxlog logs command and run the existing archived-log listing behavior to understand how datasets and timestamps are presented. Add a way to select the N most recent archived logs in chronological order, then verify that the resulting paths support the stated grep or looker workflow.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100