wer-file

Parses Report.wer files written by the Windows Error Reporting (WER) service to retrieve crash reports. Converts application crash information, exception data, operating system information, and more into structured fields for output.

Command properties

PropertyDescription
Command typeDriver query
Required permissionNone
License usageCounted
Parallel executionNot supported
Distributed executionRuns on Data Node (mapper)

Syntax

wer-file [zippath=STR] [zipcharset=STR] FILE_PATH

Options

zippath=STR
Path to the ZIP file that contains the WER file. Use this when querying a WER file directly inside a ZIP archive.
zipcharset=STR
Character set for ZIP file entries (default: utf-8).

Target

FILE_PATH
Path to the Report.wer file to query. You can use a wildcard (*) to specify multiple files. WER files are typically located in the C:\ProgramData\Microsoft\Windows\WER\ReportArchive directory.

Output fields

WER file key-value pairs are converted from CamelCase to snake_case for use as field names. The main output fields are as follows:

FieldTypeDescription
versionstringWER file format version
event_typestringEvent type (e.g., APPCRASH)
event_timestringEvent occurrence time. Value in FILETIME format
consentstringWhether the error report was consented for submission
consent_keystringError report consent key (e.g., APPCRASH)
app_namestringApplication name
app_pathstringApplication file path
app_session_guidstringSession GUID
ns_app_namestringNamespace application name (e.g., WinSCP.exe)
ns_groupstringNamespace group (e.g., windows8)
ns_partnerstringNamespace partner (e.g., windows)
original_filenamestringOriginal file name
application_identitystringApplication hash
target_app_idstringTarget application identifier
target_app_verstringTarget application version
boot_idstringBoot identifier
report_identifierstringReport GUID identifier
report_statusstringReport status
report_typestringReport type
friendly_event_namestringHuman-readable event name (e.g., stopped working)
is_fatalstringWhether the error is fatal
upload_timestringUpload time. Value in FILETIME format
metadata_hashstringMetadata hash
response_bucket_idstringResponse bucket identifier
response_bucket_tablestringResponse bucket table
response_legacy_bucket_idstringResponse legacy bucket identifier
responsetypestringResponse type
integrator_report_identifierstringIntegrator report identifier
uistringUI items. A string combining multiple items with newlines (\n)
sigsmapException information including application version, exception code, and exception offset
dynamic_sigsmapDynamic exception information
statesmapList of state values
os_infosmapOperating system information
loaded_modulesarrayList of loaded DLL file paths

Error codes

Parsing errors

N/A

Runtime errors
Error codeMessageDescriptionPost-processing action
-cannot load Report.wer fileThe WER file cannot be readStops query execution

Description

The wer-file command reads the specified WER file with UTF-16LE encoding and parses key-value pairs. Each line in the file is formatted as key=value, and key names are automatically converted from CamelCase to snake_case.

Array-format keys (Sig[n], DynamicSig[n], State[n], OsInfo[n]) are parsed as name-value pairs and assigned to the sigs, dynamic_sigs, states, and os_infos map fields respectively. Values of LoadedModule[n] keys are collected into the loaded_modules array field. Values of UI[n] keys are joined with newline characters and assigned to the ui string field.

If the version field is null, the file is considered an invalid WER file and no record is output.

To query a WER file inside a ZIP archive, specify the ZIP file path in the zippath option and the WER file path within the ZIP as the target.

Examples

  1. Retrieve a WER file

    wer-file /opt/logpresso/evidence/Report.wer
    

    Retrieves the crash report from the WER file at the specified path.

  2. Retrieve multiple WER files using a wildcard

    wer-file /opt/logpresso/evidence/ReportArchive/*/Report.wer
    

    Retrieves WER files from all subdirectories under ReportArchive.

  3. Retrieve a WER file inside a ZIP archive

    wer-file zippath=/opt/logpresso/evidence/artifacts.zip Report.wer
    

    Retrieves the crash report from the Report.wer file inside the ZIP archive.

  4. Filter for fatal errors only

    wer-file /opt/logpresso/evidence/ReportArchive/*/Report.wer
    | search is_fatal == "1"
    

    Filters for crash reports recorded as fatal errors.