Skip to content

Fix Munki 7 log parsing in status display - #4

Open
Graham Gilbert (grahamgilbert) wants to merge 1 commit into
jamf:mainfrom
grahamgilbert:fix-munki7-log-parsing
Open

Fix Munki 7 log parsing in status display#4
Graham Gilbert (grahamgilbert) wants to merge 1 commit into
jamf:mainfrom
grahamgilbert:fix-munki7-log-parsing

Conversation

@grahamgilbert

@grahamgilbert Graham Gilbert (grahamgilbert) commented Aug 13, 2026

Copy link
Copy Markdown

Problem

Munki 7 changed the timestamp format in ManagedSoftwareUpdate.log:

  • Pre-7: Aug 13 2026 02:11:46 -0700 (month-name prefix, 27 chars incl. trailing space)
  • Munki 7: 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 00 from the -07:00 offset bleeding into the status shown to the user, e.g.:

00     Downloading GoogleChrome-1.5.pkg...

Fix

  • Replace the fixed-width strip with a regex that matches both the legacy and Munki 7 timestamp formats.
  • Fold the two identical strip blocks (-munki and -airwatch cases) into a shared stripMunkiTimestamp(_:) helper.
  • Add unit tests covering both formats.

Testing

DEPNotifyTests pass for both the legacy month-name format and the Munki 7 ISO format.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants