Applicability
Splunk Enterprise 9.x.x
Description
Typical observed behavior:
- Security events from WinEventLog:Security stop forwarding.
- Other Windows Event Log inputs (e.g. Application, System) continue to index normally.
- The issue often appears after a SplunkForwarder service restart or system reboot, despite Security logs having worked previously.
Internal Splunk logs on the forwarder show access denied (ErrorCode=5) when attempting to subscribe to the Windows Security event channel.
Investigation
- Confirm ErrorCode=5 in Splunk internal logs.Below SPL can be used :
index=_internal sourcetype=splunkd ErrorCode=5
Typical error pattern:
ERROR ExecProcessor - message from "...\splunk-winevtlog.exe" splunk-winevtlog - WinEventLogChannel::init: Init failed, unable to subscribe to Windows Event Log channel 'Security': errorCode=5
This indicates a failure to subscribe to the Security channel due to access denied.
- Check when Security logs stopped :
- Determine whether Security events were indexing correctly before a recent SplunkForwarder service restart or host reboot.
- Common pattern :
- Security events flow normally.
- Service restarts (or host reboots).
- Immediately afterward, ErrorCode=5 appears and Security events stop.
- Understand Windows service token behavior :
- When a Windows service starts, it receives an access token that includes the privileges and group memberships available to its service account at that moment.
- If privileges or group memberships change later (for example, via GPO), the running service keeps using the original token and may continue to work.
- On the next restart, the service receives a new token that reflects current settings. If required rights are missing, privileged operations (such as subscribing to Security) fail.
- Verify the SplunkForwarder service account and rights :
- On the affected host:
- Confirm the Splunk Universal Forwarder service account: (Default: NT SERVICE\SplunkForwarder Or a configured domain/local account.)
- Open Local Security Policy (secpol.msc):
- Local Policies → User Rights Assignment → Manage auditing and security log.
- Check whether the SplunkForwarder service account is explicitly listed
- or whether the account is granted access via membership in "Event Log Readers" group.
- Note : At UF installation time, the installer attempts to grant the required permissions (SeSecurityPrivilege (adding account to Manage auditing and security log policy))
- Subsequent GPOs or manual changes can remove or override these permissions.
- Check for GPO overriding the local setting :
- On the same host:
- run the command "gpresult /h C:\temp\gpo_result.html"
- Then open C:\temp\gpo_result.html and review : Computer Configuration → Windows Settings → Security Settings → Local Policies → User Rights Assignment → Manage auditing and security log.
- Identify :
- Which accounts are granted this privilege.
- The winning GPO that defines the setting.
- If the SplunkForwarder account is missing from the privilege and/or not effectively granted access via Event Log Readers, and a GPO is controlling the setting, that GPO is preventing the service account from having the required rights.
- Correlate with behavior :
- When:
- The UF initially runs with appropriate rights (Security logs flow), then
- A GPO or manual change removes those rights, then
- The SplunkForwarder service is restarted
- On restart:
- The new access token no longer includes the necessary privilege/group membership.
- splunk-winevtlog.exe attempts to subscribe to the Security channel and receives access denied.
- Internal logs show ErrorCode=5, and Security events no longer flow.
Resolution
Splunk Universal Forwarder is functioning as designed. The failure is due to missing OS-level rights for the service account.
- Ensure the service account has the required rights :
- The SplunkForwarder service account (default NT SERVICE\SplunkForwarder or the configured service user) must have sufficient rights to read the Security log. This is typically satisfied if either of the following is true :
- The account is explicitly granted the Manage auditing and security log privilege in "Local Security Policy", or
- The account is a member of the "Event Log Readers" group, and the effective policies allow it to read the Security log.
- Actions for the Windows/AD team :
- Confirm that the SplunkForwarder service account has either :
- The Manage auditing and security log user right, or
- Effective access via membership in Event Log Readers (and no GPO blocking Security log access).
- Update the relevant GPO(s) or local policy so these rights are preserved on all relevant hosts.
- Apply policy and restart the service
- After updating policy and allowing GPOs to refresh, restart the Splunk Universal Forwarder service.
- On restart, a new access token is created with the correct privileges/group memberships.
- The forwarder should now successfully subscribe to WinEventLog:Security.
- Verify :
- Confirm that ErrorCode=5 messages no longer appear in _internal index.
- Verify that new Security events are being collected and indexed as expected.
Windows Error Codes
Manage SePrivilegeUser permissions
Revision History
| Revision |
Publish Date |
Comments |
1.0 |
01-Oct-2026
|
Initial Release |