Fix Munki 7 log parsing in status display - #4
Open
Graham Gilbert (grahamgilbert) wants to merge 1 commit into
Open
Fix Munki 7 log parsing in status display#4Graham Gilbert (grahamgilbert) wants to merge 1 commit into
Graham Gilbert (grahamgilbert) wants to merge 1 commit into
Conversation
Munki 7 changed its log timestamp format from a month-name prefix
("Aug 13 2026 02:11:46 -0700") to ISO 8601 with milliseconds and a
colon timezone ("2026-08-12 07:22:31.771-07:00"). The status parser
stripped a fixed 27 characters off each line to remove the timestamp,
which was calibrated to the old format; against Munki 7 lines it left
"00 " from the "-07:00" offset bleeding into the displayed status.
Replace the fixed-width strip with a regex that matches both the legacy
and Munki 7 timestamp formats, and fold the two identical strip blocks
(the -munki and -airwatch cases) into a shared helper. Add unit tests
covering both formats.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
macnotes (macnotes)
approved these changes
Aug 13, 2026
Neil Martin (neilmartin83)
approved these changes
Aug 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Munki 7 changed the timestamp format in
ManagedSoftwareUpdate.log:Aug 13 2026 02:11:46 -0700(month-name prefix, 27 chars incl. trailing space)2026-08-12 07:22:31.771-07:00(ISO 8601, milliseconds, colon timezone)The Munki/AirWatch status parser stripped a fixed 27 characters off each log line to remove the timestamp — a magic number calibrated to the old month-name format. Against Munki 7 lines this leaves the trailing
00from the-07:00offset bleeding into the status shown to the user, e.g.:Fix
-munkiand-airwatchcases) into a sharedstripMunkiTimestamp(_:)helper.Testing
DEPNotifyTestspass for both the legacy month-name format and the Munki 7 ISO format.