Join our Newsletter — 33% off our NHI Course
Home› Guides› macOS Unified Log Forensics Guide: Predicates and Queries…
Guide Incident Response & Forensics

macOS Unified Log Forensics Guide: Predicates and Queries for Investigations

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 28 November 2026 12 min read
On this page

The macOS unified log holds much of the evidence of what happened on a Mac, but investigators lose it to retention limits, redaction and badly scoped queries. This guide goes deep on one artefact: how to collect the log without losing data, how the predicate language works, which fields carry investigative value, query patterns for common investigation questions, and how to scale the work across a fleet. It is written for incident responders, forensic examiners and detection engineers who already know the wider macOS artefact set. Storage paths, the tracev3 format and the other macOS artefacts are covered in the macOS Forensics Guide; this page assumes that background.

Key takeaways

  • Collect first, query later. The on-disk store is purged by size, so take a logarchive with sudo log collect as early as possible and run every query against the archive, not the live system.
  • Know what was never written. Apple documents that debug messages are not persisted and info messages are persisted only when collected with the log tool, so absence of a debug line proves nothing.
  • Filter on structured keys. Predicates on process, subsystem, category and messageType are faster and more defensible than free-text searches of eventMessage.
  • Expect redaction. Dynamic strings are redacted as <private> by default; private data logging can be enabled by profile on managed Macs, but only as a deliberate, documented decision before an incident.
  • Keep a tested predicate library. Version-control the predicates you use, validate them on each macOS release, and ship the high-value ones to your SIEM so evidence exists before you need it.

How the log decides what is kept

Apple's developer documentation describes five levels. The level a developer chooses decides whether a message ever reaches disk, which is the first thing to understand before drawing conclusions from a query.

Level (messageType)Persisted to disk (Apple documentation)Forensic implication
DebugNoOnly visible in a live stream or after logging was raised by configuration; not in a post-incident collection
InfoOnly when collected with the log toolMay appear in a fresh logarchive but not reliably for older periods
Notice (Default)Yes, up to a storage limitThe bulk of usable historical evidence
ErrorYes, up to a storage limitFailures, often with extra process chain context when an activity exists
FaultYes, up to a storage limitSerious faults, also with process chain context

When the on-disk data store exceeds its predefined size, Apple states the system purges old messages to make room for new ones. The Mandiant macos-UnifiedLogs project notes that logs typically retain about 30 days of information, but on a busy Mac some categories cover far less. Retention is a property of volume, not time, so record the earliest timestamp present in each archive as part of your evidence notes.

Two other Apple behaviours shape every investigation. Messages carry a subsystem, which Apple asks developers to write in reverse-DNS notation (for example com.example.myapp), and a category for a component inside that subsystem. And by default the system redacts dynamic strings and complex objects while leaving integers, floating-point and Boolean values visible, which is why user names, paths and URLs often appear as <private>.

Collecting the log without losing evidence

  1. Decide on live response. If the Mac is still running, collect the unified log before reboots, updates or clean-up scripts add volume and push older entries out.
  2. Create a logarchive. Run log collect as root with an --output path on external or network storage. Use --last or --start to bound the window only when the full store is too large to move; a full collection is the safer default.
  3. Hash and record. Hash the .logarchive bundle, and record the host name, macOS version, collection command, time zone and the earliest and latest timestamps.
  4. Fallback for dead-box images. The Mandiant project documents building an archive manually by copying the contents of /private/var/db/uuidtext and /private/var/db/diagnostics into one directory. Copying diagnostics alone leaves messages without their format strings.
  5. Work on a copy. Analyse with log show --archive on an examiner Mac, or parse the copy cross-platform with Mandiant's unifiedlog_iterator, which writes JSONL or CSV.
  6. Check for loss. Run log show with --loss, and log stats against the archive, to see volume per process and gaps. Messages such as <Missing message data> or decode errors mean referenced data rolled or was deleted, which you should note rather than ignore.

Fleet response tools can wrap these steps. The open-source Jamf Aftermath framework, for example, runs a set of default predicates with log show using the --info, --debug, --loss and --signpost options and saves each result to its own file; it needs root and Full Disk Access.

The predicate language

log show, log stream and log collect accept --predicate filters written in Apple's NSPredicate syntax. The log(1) manual lists the keys you can filter on, and the operators follow standard predicate syntax: ==, !=, CONTAINS, BEGINSWITH, ENDSWITH, LIKE, MATCHES, with AND, OR and NOT, and [c] for case-insensitive comparison.

KeyWhat it matchesInvestigative use
processName of the process that emitted the messageScope to a daemon such as sshd, sudo or tccd
processImagePathFull path of the process binaryCatch binaries running from unusual paths such as /tmp or a user Downloads folder
senderLibrary or framework that logged the messageSeparate framework noise from the application itself
senderImagePathPath of the sending librarySpot unexpected libraries loaded into a process
subsystemReverse-DNS subsystem stringThe most precise scope for Apple and third-party components
categoryComponent inside a subsystemNarrow a subsystem to one feature
messageTypeLevel: default, info, debug, error, faultPull only errors and faults around a crash or tamper attempt
eventTypeType of event, for example log, activity or signpost eventsSeparate activity and signpost records from ordinary log messages
eventMessageThe rendered message textLast-step refinement with CONTAINS, after structured filters

Useful log show options from the manual: --archive to read a bundle, --start and --end (with a time zone offset where the evidence spans zones), --last with a number and unit or boot, --info and --debug (hidden by default), --style json or ndjson for machine processing, --timezone to normalise output, and --process to limit to a PID or name.

Query patterns for common investigation questions

The predicates in this table are the defaults shipped in the Jamf Aftermath source code, reproduced as published, and labelled here as samples. Message strings and process names change between macOS releases, so validate each one on a reference Mac running the same version as the evidence before relying on a negative result.

QuestionSample predicate (Aftermath default)Notes
Who logged in, and when?process == "logind"Combine with Aftermath's login window example: processImagePath contains "loginwindow" and eventMessage contains "com.apple.sessionDidLogin"
Were privacy permissions requested or granted?process == "tccd"Pair with the TCC database; see the macOS TCC and Privacy Permissions Management Guide
Was there remote shell access?process == "sshd"Maps to ATT&CK T1021.004 SSH
Were sudo passwords guessed?process == "sudo" and eventMessage CONTAINS "TTY" AND eventMessage CONTAINS "3 incorrect password attempts"Relevant to T1548.003 Sudo and Sudo Caching; widen to process == "sudo" to see successful use
Was a configuration profile installed by hand?subsystem == "com.apple.ManagedClient" AND process == "mdmclient" AND category == "MDMDaemon" and eventMessage CONTAINS "Installed configuration profile:" AND eventMessage CONTAINS "Source: Manual"Manual profiles can add certificates, proxies or VPNs outside MDM control
Was screen sharing used?(process == "screensharingd" || process == "ScreensharingAgent")Maps to T1021.005 VNC
Did Apple's built-in malware remediation act?subsystem == "com.apple.XProtectFramework.PluginAPI" && category == "XPEvent.structured"XProtect Remediator structured events

Build investigation-specific predicates the same way: start with the narrowest structured key you know (subsystem, then process), add a time window, and only then add eventMessage conditions. Run log stats --archive with --process or --sender first to see which processes are noisy in the window, which tells you where a predicate needs tightening.

Working a timeline

  • Anchor on a known event: a malicious download time from quarantine data, an EDR alert or a login, then query a window either side.
  • Pivot on activity ID: related messages share an activity identifier, so once you find one relevant line, filter on its activity to see the related chain.
  • Pivot on boot UUID: the boot UUID separates boot sessions and shows reboots that may explain gaps.
  • Export structured output: use --style ndjson or Mandiant's JSONL output to load results into a timeline tool alongside FSEvents and persistence artefacts.

Private data and redaction

Redacted values appear as <private>; Jamf's public filter repository gives the example "Password changed for <private>", which shows the user name only when private data logging is enabled. Apple's SystemLogging configuration profile payload (payload type com.apple.system.logging, macOS 10.12 and later) has a System dictionary whose single key, Enable-Private-Data, enables private data logging for the entire system when set to true. A Subsystems dictionary in the same payload can raise levels for named subsystems using the Level Enable and Persist values Apple documents (Inherit, Default, Info, Debug).

  • Decide in advance: enabling private data after an incident does not recover values already redacted.
  • Weigh the privacy cost: private data logging exposes user names, paths and other personal data to anyone who can read the logs, so treat it as a data protection decision and document the lawful basis for corporate devices.
  • Prefer targeted levels: raising one subsystem to Info with Persist settings is narrower than system-wide private data, and Apple notes categories inherit their subsystem's behaviour unless overridden.
  • Watch for tampering: an unexpected logging profile, or log config changes made with root, can raise or suppress logging. Treat changes to /Library/Preferences/Logging/Subsystems as an indicator worth checking.

Decision guidance: tools and scale

ApproachBest forTrade-offs
log show on an examiner MacSingle-host deep dives, exact Apple renderingNeeds macOS; manual and slow across many archives
Mandiant macos-UnifiedLogs (unifiedlog_iterator)Parsing on Linux or Windows, bulk export to JSONL or CSVLarge output; the README notes it outputs raw error numbers rather than the human-readable strings log provides
Response frameworks such as Jamf AftermathFleet collection with a default predicate set plus other artefactsDefault predicates are a starting set, not full coverage
Streaming selected predicates to a SIEMEvidence that survives local purge, detection in near real timeOnly covers what you chose in advance; needs an agent or MDM-deployed tool
  • Small teams: collect a full logarchive per affected Mac and query with log show; keep a short, tested predicate file.
  • Large fleets: forward the high-value predicates centrally so that 30 days of local retention is not the limit, and reserve full collection for hosts in scope.

Where identity fits

Many unified log questions are identity questions: which local or directory account logged in, which account used sudo, which process was granted a privacy permission, and whether an SSH key or a service account was used for remote access. Correlate unified log logins with your identity provider and Platform SSO records, and treat local admin accounts and automation accounts on Macs as non-human identities with owners. See the macOS Platform SSO and Directory Binding Guide.

Detection and measurement

Attackers who gain root can delete or tamper with log data or change logging configuration, which ATT&CK v20 covers under T1070 Indicator Removal and T1685 Disable or Modify Tools. Off-host copies are the main defence. Measure readiness with:

  • Forwarding coverage: percentage of managed Macs streaming the agreed predicate set to the SIEM.
  • Local depth: median age of the earliest entry on a sample of Macs, checked quarterly.
  • Time to archive: minutes from incident declaration to a hashed logarchive in evidence storage.
  • Predicate validation: share of library predicates re-tested on the latest macOS release.
  • Tamper alerts: count of unexpected logging profiles or log configuration changes investigated.

Common failure patterns

  • Querying the live system for days: every hour the Mac keeps running, new volume can push older entries out of the store.
  • Copying only the diagnostics folder: without uuidtext the messages cannot be rendered.
  • Reading absence as proof: debug messages were never persisted, info messages may not be, and a predicate may simply no longer match on a newer macOS release.
  • Free-text first: broad eventMessage CONTAINS searches across a full archive are slow and return noise; start from process or subsystem.
  • Ignoring time zones: mixing local and UTC output across hosts misorders the timeline; set --timezone consistently.
  • Turning on private data reactively: it does not restore redacted history and creates a data protection issue if left on.

Framework mapping

FrameworkReferenceRelevance
NIST CSF 2.0DE.AE-02, RS.AN-03Analysing adverse events and establishing what happened during an incident
NIST SP 800-53 Rev 5AU-9, AU-11, IR-4Protecting and retaining audit information, incident handling
ISO/IEC 27001:2022 Annex AA.8.15 Logging, A.5.28 Collection of evidenceLog generation and protection, evidence handling
CIS Controls v8.18.10 Retain audit logsCentral retention beyond local purge
MITRE ATT&CK v20T1021.004, T1021.005, T1548.003, T1070, T1685Techniques the sample predicates help investigate, and log tampering

Practitioner checklist

  • Collect a full logarchive with sudo log collect before any remediation, and hash it.
  • Record macOS version, time zone, and earliest and latest timestamps for every archive.
  • For images, copy both uuidtext and diagnostics into the archive directory.
  • Run log stats and --loss to understand volume and gaps before querying.
  • Filter on process, subsystem and category first, then eventMessage.
  • Keep a version-controlled predicate library and re-test it on each macOS release.
  • Forward high-value predicates to the SIEM from managed Macs.
  • Decide and document your private data logging position before an incident.
  • Alert on unexpected logging profiles and logging configuration changes.

Standards and references

Related NHI Mgmt Group resources: macOS Forensics Guide · macOS Detection and Response Guide · macOS LOOBins · Anti-Forensics Detection Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.