Collect logs with the Collector for Windows
Collect Windows host logs with the Splunk Distribution of OpenTelemetry Collector and send them to the Splunk platform.
Prerequisites
-
A running Splunk Enterprise or Splunk Cloud Platform deployment.
-
A Splunk HTTP Event Collector (HEC) token with write access to the target index. For more information, see Use HTTP Event Collector.
-
A Windows host where you can install the Splunk Distribution of OpenTelemetry Collector.
Install the Collector with log collection enabled
Pass the Splunk HEC endpoint URL, token, and target log index to the installer by using msi_public_properties.
& {
Set-ExecutionPolicy Bypass -Scope Process -Force
$script = (New-Object System.Net.WebClient).DownloadString('https://dl.observability.splunkcloud.com/splunk-otel-collector.ps1')
$params = @{
msi_public_properties = "SPLUNK_PLATFORM_URL=<URL> SPLUNK_PLATFORM_TOKEN=<TOKEN> SPLUNK_PLATFORM_LOGS_INDEX=<INDEX>"
}
& ([scriptblock]::Create($script)) @params
}
To also send metrics and traces to Splunk Observability Cloud, include your Splunk Observability Cloud access token and realm:
& {
Set-ExecutionPolicy Bypass -Scope Process -Force
$script = (New-Object System.Net.WebClient).DownloadString('https://dl.observability.splunkcloud.com/splunk-otel-collector.ps1')
$params = @{
access_token = "<ACCESS_TOKEN>"
realm = "<REALM>"
msi_public_properties = "SPLUNK_PLATFORM_URL=<URL> SPLUNK_PLATFORM_TOKEN=<TOKEN> SPLUNK_PLATFORM_LOGS_INDEX=<LOGS_INDEX>"
}
& ([scriptblock]::Create($script)) @params
}
Installer options
Use these MSI public properties to send Windows logs to the Splunk platform:
|
Property |
Description |
|---|---|
|
|
Required. The Splunk HEC endpoint URL, such as |
|
|
Required. The Splunk HEC token that authenticates requests to the Splunk platform. |
|
|
Recommended. The Splunk index to send logs to. If you omit this property, the Splunk platform routes logs according to the default index configured for the HEC token. |
To avoid missing data because of index routing, set SPLUNK_PLATFORM_LOGS_INDEX or make sure the HEC token has a default index.
Collected logs
By default, the Collector tails logs from common Windows file locations, including DHCP server logs, Windows Update logs, Netlogon logs, and firewall logs. The Collector also monitors Windows Event Log channels, including Application, Security, System, ForwardedEvents, DFS Replication, Directory Service, File Replication Service, DNS Server, Key Management Service, Microsoft-Windows-PrintService/Operational, and Microsoft-Windows-Windows Defender/Operational. This behavior mirrors the Splunk Add-on for Microsoft Windows.
For the full list of included paths and receivers, see splunk_logs_config_windows.yaml.
Activate or deactivate receivers
-
Edit
C:\ProgramData\Splunk\OpenTelemetry Collector\splunk_logs_config_windows.yamland comment or uncomment receivers in theservice.pipelinessection:YAMLservice: pipelines: logs/application: receivers: [windows_event_log] processors: [transform/application, resource_detection] exporters: [splunk_hec/logs] logs/security: receivers: [windows_event_log/security] processors: [transform/security, resource_detection] exporters: [splunk_hec/logs] -
Restart the Collector service:
POWERSHELLRestart-Service splunk-otel-collector
Add log files
Each file_log receiver has an include list of glob patterns. To collect logs from a custom application, add the application path to a file_log receiver:
file_log/dhcp:
include:
- '${env:SystemRoot}\System32\DHCP\DhcpSrvLog*'
- '${env:SystemRoot}\SomeOtherDirectory\DHCP*.log'
To exclude files within a matched pattern, add the files to the exclude list:
file_log/firewall:
include:
- '${env:SystemRoot}\System32\LogFiles\Firewall\*'
exclude:
- '${env:SystemRoot}\System32\LogFiles\Firewall\sensitive_data.log'
For the full glob syntax and available options, see the filelog receiver documentation and the Windows Event Log receiver documentation.
Verify log ingestion
Run a search in Splunk Cloud Platform or Splunk Enterprise for events that use the default receiver source type:
index="<your-index>" sourcetype="XmlWinEventLog"
To view all source types currently being ingested, run the following search:
index="<your-index>" | stats count by sourcetype
Sizing
Log collection with the filelog receiver scales differently than metrics and traces. CPU usage depends mostly on the number of monitored files, not only total throughput.
Use the following CPU recommendations as a starting point for common file counts and per-file rates:
| Files | Lines per second per file | Total throughput | Recommended CPUs |
|---|---|---|---|
| <= 100 | 100 | 10,000 lines per second | 0.5 |
| <= 500 | 100 | 50,000 lines per second | 1 |
| <= 1,000 | 100 | 100,000 lines per second | 2 |
| <= 50 | 1,000 | 45,000 lines per second | 0.5 |
| <= 100 | 1,000 | 90,000 lines per second | 1 |
| <= 150 | 1,000 | 135,000 lines per second | 2 |
These values were tested with plain-text log lines and no parsing or field extraction in the Collector pipeline. In these tests, log line size was not the main driver of resource usage. Most Collector resources were spent monitoring files and processing records.
filelog. With block_on_overflow: true, the receiver pauses reading when the queue is full instead of increasing memory usage indefinitely. However, the default memory limit of 512 MB can be too small under higher load. Increase SPLUNK_MEMORY_LIMIT_MIB when the memory_limiter processor starts refusing new data.
At equal events per second, more files require more CPU. The following examples show observed CPU usage from the source sizing tests:
| Scenario | Total throughput | Average CPU observed |
|---|---|---|
| 10 files at 1,000 lines per second | About 10,000 lines per second | About 9% |
| 100 files at 100 lines per second | About 10,000 lines per second | About 14% |
| 50 files at 1,000 lines per second | About 45,000 lines per second | About 39% |
| 500 files at 100 lines per second | About 50,000 lines per second | About 84% |
-
CPU scales approximately linearly with throughput for a similar file shape and pipeline configuration.
-
Using multiple
filelogreceivers can reduce CPU usage at high file counts. -
For vertical scaling, Splunk HEC and the indexing tier are often the limiting factors. Size HEC and the indexing tier for the expected load so retries and backpressure don't increase Collector resource usage.
-
JSON parsing, regex operators, and similar processing stages increase CPU usage above these baseline values.
Validate these starting values against your log shape, file count, and downstream capacity.