How to collect Applications and Services Logs from Windows event logs

How to collect Applications and Services Logs from Windows event logs


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
  1. Get-WmiObject -Query "Select EventCode,SourceName,TimeGenerated,Type,Message,Logfile from Win32_NTLogEvent WHERE ( LogFile = '<LogFileName>' )" | select -First 1
  1. Here, LogFileName is the name of the category of events that you wish to collect.
Info
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.

Notes
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.
QuoteRegistry location: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog
For 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.
InfoRegistry 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:
  1. Navigate to Event Viewer → Applications and Services Logs.
  2. Select the required category under your applications.
  3. Click the Details tab.
  4. Expand the System section.
  5. Copy the Channel value as shown in the screenshot below.
  6. Use this Channel value as a Registry key when adding to the Windows Registry, as shown in the screenshot above.
  7. 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:

  1. Navigate to SettingsAppLogs ConfigurationLog Profiles and click on the edit icon of the Windows Event Log profile you've configured.
  2. In the Edit Log Profile window that opens, paste the registry key in the field next to Windows Event Types.
  3. Click Save.


Quoting another example, if you want to collect logs from the RemoteConnectionManager/Operational category, then enter the below key.
Quote
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.

                    New to ADSelfService Plus?

                      • Related Articles

                      • How to monitor Event Logs in "Applications and Services Log" ?

                        Explanation : Upon investigation, we discovered that the Win32_NTLogEvent WMI class, by default, includes only standard Event Log categories found under "Windows Logs." To access specific log names under "Applications and Services Logs," a ...
                      • Filtering Windows event logs before uploading

                        You can filter Windows event logs on the agent side before uploading them to Applications Manager. You can configure to eliminate the unwanted event IDs, so that you can skip them while uploading. You can set these field configurations while adding a ...
                      • Using Kerberos Authentication with ManageEngine Applications Manager for Windows Monitoring

                        What is Kerberos? Kerberos is a secure authentication protocol used in Active Directory (AD) domains. It uses encrypted "tickets" instead of passwords to allow ManageEngine Applications Manager to connect to a target server securely. When a server is ...
                      • Downloading Agent Logs from Remote Servers for Troubleshooting

                        Applications Manager allows you to remotely collect server agent logs from monitored machines for troubleshooting purposes. The retrieved logs are compressed and stored on the Applications Manager server. Supported Versions Server Agent version ...
                      • How to install .NET agent on Azure app services?

                        You can track the performance of your .NET and .NET Core web app's key metrics like response time, throughput, and Apdex score via the APM Insight .NET agent hosted in Azure App Services. Installing APM Insight extension via Azure portal 1. Log in to ...