Applications Manager AppLogs uses the Windows Management Instrumentation (WMI) query on the Applications Manager FSO agent to fetch event logs. The WMI module requires the registry entry below to read the event logs from the Applications and Services Log group.
Running the WMI query
For this, you have to first confirm if the log file can be accessed through Win32_NTLogEvent using the following WMI query in PowerShell. This is the same query that the Applications Manager FSO agent runs to collect the events.
Query:
PowerShell
- Get-WmiObject -Query "Select EventCode,SourceName,TimeGenerated,Type,Message,Logfile from Win32_NTLogEvent WHERE ( LogFile = '<LogFileName>' )" | select -First 1
- Here, LogFileName is the name of the category of events that you wish to collect.
Ex: we are considering here, LogFileName can be Microsoft-Windows-PrintService/Admin or Microsoft-Windows-TerminalServices-RemoteConnectionManager/Operational.
If there are no results for this query, the log file cannot be accessed, and you need to add it through the Windows Registry.
Note: A registry entry is not mandatory for all event type categories in the Applications and Services Log group. Check if your entry is present in WMI, and then add if not.
Adding through the Windows Registry
You can add event log files through the Windows Registry. For this, you have to navigate to the Windows Registry from your Windows machine and go to the Registry location.
Registry location: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLogFor example: if you want to collect logs from the Microsoft-Windows-PrintService/Admin category, then you need to add the below key in the Windows Registry.
Registry key: Microsoft-Windows-PrintService/Admin
Finding the correct Channel value:
When providing the Registry key, ensure that you enter the Channel value as a complete string in the registry. Follow these steps:
- Navigate to Event Viewer → Applications and Services Logs.
- Select the required category under your applications.
- Click the Details tab.
- Expand the System section.
- Copy the Channel value as shown in the screenshot below.
- Use this Channel value as a Registry key when adding to the Windows Registry, as shown in the screenshot above.
- Once you add it to the Windows Registry, make sure to run the WMI query mentioned in the section "Running the WMI query" using the <LogFileName> as the registry key created above.
Configuring the Log Profile:
Once you add it to the Windows Registry, make sure to run the WMI query mentioned in the section "Running the WMI query," using the <LogFileName> as the registry key created above.
You have to enter this registry key while adding or editing a Log Profile for Windows event logs. For this:
- Navigate to Settings → AppLogs Configuration → Log Profiles and click on the edit icon of the Windows Event Log profile you've configured.
- In the Edit Log Profile window that opens, paste the registry key in the field next to Windows Event Types.
- Click Save.
Quoting another example, if you want to collect logs from the RemoteConnectionManager/Operational category, then enter the below key.
Registry key: Microsoft-Windows-TerminalServices-RemoteConnectionManager/Operational
In this case, paste the above key in the field next to Windows Event Types to collect remote connection manager logs.
Similarly, you can paste the required keys next to the List of files to search for logs field in the Log Profile to collect other Applications and Services Logs from Windows event logs.