Navigation

Documentation

IME Log Patterns

IME Log Patterns are regular expressions (regex) that the Autopilot Monitor agent uses to parse the Intune Management Extension (IME) log file in real time. Each line of the IME log is matched against the active patterns — when a regex matches, the agent extracts data via named capture groups and fires the corresponding action, producing a structured event that appears in the session timeline.

Why regex?

The IME log is a plain-text file with no structured format. Regex patterns allow the agent to reliably extract information from free-form log lines — app download progress, install status changes, ESP phase transitions, and more — without depending on a specific log format version.

How It Works

1. Pattern Matching

The agent reads the IME log line by line. Each line is tested against all active patterns whose category applies to the current enrollment phase.

2. Data Extraction

When a regex matches, named capture groups (e.g. (?<appId>...)) extract values from the log line and pass them to the action handler.

3. Event Generation

The action handler processes the extracted data and emits a structured event — for example an app state change, an ESP phase transition, or an error detection.

Pattern Structure

Each pattern is a JSON object with the following fields:

FieldDescription
patternIdUnique identifier for the pattern (e.g. IME-DOWNLOADING).
categoryWhen the pattern is active: always, currentPhase, or otherPhases.
patternThe regex (C# syntax) applied to each log line. Uses named capture groups to extract values.
actionThe handler that processes the match (e.g. updateStateDownloading).
descriptionHuman-readable description of what the pattern detects.
enabledWhether the pattern is active. Disabled patterns are skipped during log parsing.
parametersOptional key-value pairs passed to the action handler for additional configuration.

Categories

Categories control when a pattern is evaluated relative to the current ESP phase:

always

Evaluated on every log line, regardless of the current phase. Used for universal signals like agent version detection, IME restarts, or enrollment completion.

currentPhase

Only evaluated during the active ESP phase. Used for tracking app downloads, installs, and other progress within the phase the user is currently in.

otherPhases

Evaluated for non-active phases. Used to detect apps that were already completed in a previous phase, so they can be filtered from the current view.

Actions

Each pattern specifies an action — a handler in the agent that processes the regex match and produces the corresponding event. The action determines what happens when the pattern matches.

ActionPurposeCapture Groups
imeAgentVersionDetect IME agent versionagentVersion
imeStartedIME agent started
espPhaseDetectedESP phase transitionespPhase
policiesDiscoveredApp policies JSON foundpolicies
setCurrentAppSet current app being processedid
updateStateDownloadingApp download progressbytes, ofbytes
updateStateInstallingApp installation started
updateStateInstalledApp installation completed
updateStateErrorApp error detected
updateStateSkippedApp skipped
updateStatePostponedApp postponed
espTrackStatusESP tracked install statusfrom, to, id
updateNameUpdate app display nameid, name
updateWin32AppStateWin32 app state changeid, state
ignoreCompletedAppApp already completed in prior phase
cancelStuckAndSetCurrentCancel stuck app, set new currentid
enrollmentCompletedEnrollment completed

Named Capture Groups

Capture groups are the bridge between the regex and the action handler. They use the syntax (?<name>...) to extract specific values from the matched log line.

GUID Placeholder

Patterns can use the {GUID} placeholder, which the agent automatically expands to a standard GUID regex pattern. This avoids repeating the verbose GUID regex in every pattern that needs to match application IDs.

Example Patterns

Example 1 — Detect IME Agent Version

Category: always — matches on every log line

// Pattern

Agent version is: (?<agentVersion>[\d.]+)

// Action: imeAgentVersion

What happens

When the IME log contains Agent version is: 1.83.2405.0001, the capture group agentVersion extracts 1.83.2405.0001 and the agent records the IME version for the session.

Example 2 — Track App Download Progress

Category: currentPhase — only active during the current ESP phase

// Pattern

\[StatusService\] Downloading app \(id = {GUID}.*?\) via (?<tech>\w+), bytes (?<bytes>\w+)/(?<ofbytes>\w+) for user

// Action: updateStateDownloading

What happens

Extracts the download technology (tech: DO or CDN), bytes downloaded (bytes), and total size (ofbytes). The agent updates the app state to "downloading" with real-time progress.

Example 3 — ESP Phase Transition

Category: always — critical for tracking enrollment progress

// Pattern

\[Win32App\] (?:In|The) EspPhase: (?<espPhase>\w+)

// Action: espPhaseDetected

What happens

Detects when the IME transitions between ESP phases (e.g. DeviceSetup, AccountSetup). This drives the phase-aware filtering of currentPhase and otherPhases patterns.

Contributing Patterns

Microsoft occasionally changes log formats in the Intune Management Extension. When this happens, existing patterns may stop matching. If you notice that a pattern no longer fires for log lines it should match, you can help by submitting a pull request on GitHub with an updated or new pattern.

Debugging with the IME Pattern Match Log

If you suspect a pattern is no longer matching, enable the IME Pattern Match Log in the Settings page. When enabled, the agent writes every matched IME log line to a local file at %ProgramData%\AutopilotMonitor\Logs\ime_pattern_matches.log. This lets you see exactly which patterns are firing and which log lines are going unmatched — making it much easier to identify what changed in the log format and adjust the regex accordingly.

How to contribute

  1. Enable the IME Pattern Match Log in Settings and run an enrollment to capture which patterns match and which don't.
  2. Open the IME Log Patterns page in the portal and find the pattern that no longer matches.
  3. Use View as JSON to see the full pattern definition — this makes it easy to copy the current state.
  4. Compare the regex with the actual log lines from the match log to identify what changed.
  5. Submit a pull request on the Autopilot Monitor GitHub repository with your updated pattern JSON. Pattern files are located in the rules/ime-log-patterns/ directory.
  6. The team reviews the PR, validates the regex against known log samples, and merges it if it looks good.

IME Log Patterns page

Use the IME Log Patterns page in the portal to browse and filter all active patterns. The page shows each pattern with its regex, action, category, and description. Use the View as JSON toggle to see the full pattern definition — especially useful when preparing a pull request with updated or new patterns.