08 - Troubleshooting

Errores realmente encontrados durante la instalación en este PC (referencia rápida para el analista).

1. Problem parsing indexes.conf: homePath must be absolute

Síntoma al hacer splunk restart en el indexer:

Problem parsing indexes.conf: Cannot load IndexConfig:
Cannot create index 'win_app': path of homePath must be absolute
('"C:\Program Files\Splunk\var\lib\splunk/win_app/db')

Causa: generamos el indexes.conf en PowerShell con string interpolación; la variable $SPLUNK_DB (variable propia de Splunk) fue expandida por PowerShell antes de escribir el archivo. Por ejemplo, doble comilla sin cerrar y/o interpolación rota.

Solución: usar here-string single-quoted para que $SPLUNK_DB quede literal en el archivo (Splunk la interpreta al cargar):

$tpl = @'
[{NAME}]
homePath   = $SPLUNK_DB/{NAME}/db
coldPath   = $SPLUNK_DB/{NAME}/colddb
thawedPath = $SPLUNK_DB/{NAME}/thaweddb
maxTotalDataSizeMB = 5000
 
'@
foreach ($i in 'win_security','win_system',...) {
    $content += ($tpl -replace '\{NAME\}',$i)
}
Set-Content -Path idxPath -Value $content -Encoding UTF8

Resultado correcto:

[win_security]
homePath   = $SPLUNK_DB/win_security/db
...

Ver Anexo C - indexes.conf.

2. App pre-instalada botsv3_data_set con props.conf inválido

Síntoma:

C:\Program Files\Splunk\etc\apps\botsv3_data_set\default\props.conf, line 102:
Cannot parse into key-value pair: EXTRACT-src ^(?<src_ip>[^s]+)

Causa: la app botsv3_data_set (dataset de BOSS of the SOC v3) se instala con una línea tipo:

EXTRACT-src ^(?<src_ip>[^s]+)   # <-- falta el '='

Splunk exige EXTRACT-<class> = <regex>. Está app está rota y NO es nuestra.

Solución: renombrar el archivo problemático para que Splunk NO lo parse:

Move-Item 'C:\Program Files\Splunk\etc\apps\botsv3_data_set\default\props.conf' `
          'C:\Program Files\Splunk\etc\apps\botsv3_data_set\default\props.conf.bak' -Force

Ojo: disabled = true en local\app.conf NO evita el parseo de default\*.conf en btool check. Renombrar el archivo es lo que sí lo salta.

3. Falso positivo al detectar props.conf inválido

Mi primer script de detección usó el regex:

^\s*EXTRACT-[A-Za-z0-9_\-]+\s+[^^=]

El [^^=] excluye ^ y =, así que captura cualquier espacio como inicio de valor. Esto mal-clasificó splunk_monitoring_console\default\props.conf (que tiene EXTRACT-x = value, con doble espacio pero = presente) como inválido.

Solución: regex más preciso, que mire el primer no-espacio tras EXTRACT-x:

^\s*EXTRACT-[A-Za-z0-9_\-]+\s+[^=\s]

El rename erróneo fue revertido moviendo de vuelta .bak.

4. Invalid key in stanza [tcpout] ... : useAck (value: true)

Síntoma al arrancar el UF:

Invalid key in stanza [tcpout] in outputs.conf, line 3: useAck (value: true).
Your indexes and inputs configurations are not internally consistent.

Causa: Splunk es case-sensitive en los keys. El key correcto es useACK (con K mayúscula).

Solución: editar outputs.conf del UF:

useACK = true   # en lugar de useAck

Reiniciar el UF.

5. UAC cancelado por error

Síntoma: al ejecutar Start-Process -Verb RunAs, PowerShell lanzó:

Start-Process : Este comando no se puede ejecutar debido al error: El usuario ha cancelado la operación.

Causa: en el prompt “¿Quieres que está aplicación efectúe cambios?” se pulsó No o se cerró.

Solución: reintentar el comando y aceptar el UAC.

6. Comandos útiles para post-mortem

# Btool con debug (indexer)
& 'C:\Program Files\Splunk\bin\splunk.exe' btool check --debug 2>&1 | Select-String 'line |Cannot parse|inconsistent'
 
# Btool outputs (UF)
& 'C:\Program Files\SplunkUniversalForwarder\bin\splunk.exe' btool outputs list --debug
 
# Estado servicios
Get-Service Splunkd,SplunkForwarder | Format-Table Name,Status,StartType
 
# Puertos esperados
foreach ($p in 8000,8089,9997) {
    $t = Test-NetConnection 127.0.0.1 -Port $p -WarningAction SilentlyContinue
    "Puerto $p : $($t.TcpTestSucceeded)"
}

7. win_sysmon = 0 eventos (Sysmon canal access denied)

Síntoma:

ERROR splunk-winevtlog - WinEventLogChannel::subscribeToEvtChannel: Could not subscribe
to Windows Event Log channel 'Microsoft-Windows-Sysmon/Operational': errorCode=5

errorCode=5 = ERROR_ACCESS_DENIED — el UF no tiene permisos para leer el canal Sysmon.

Causa raíz:

  • El canal Sysmon (Microsoft-Windows-Sysmon/Operational) tiene isolation=Custom y un SDDL restrictivo por defecto:
    O:BAG:SYD:(A;;0xf0007;;;SY)(A;;0x7;;;BA)(A;;0x1;;;BO)(A;;0x1;;;SO)(A;;0x1;;;S-1-5-32-573)
    
    Solo da read a System, Administrators, Backup Operators, Server Operators y Event Log Readers (S-1-5-32-573).
  • El UF corre como NT SERVICE\SplunkForwarder (cuenta virtual), que NO está en ninguno de esos grupos (a diferencia de LocalSystem que sí).
  • Resultado: el UF arranca y todos los demás índices (win_security, win_powershell, win_wmi…) llegan, pero win_sysmon queda en 0.

Diagnóstico:

# (admin)
# 1. Cuenta efectiva del UF
Get-CimInstance Win32_Service -Filter "Name='SplunkForwarder'" | Select-Object StartName,State
 
# 2. SDDL actual canal Sysmon
wevtutil get-log 'Microsoft-Windows-Sysmon/Operational' | Select-String channelAccess
 
# 3. Log del UF
Get-Content 'C:\Program Files\SplunkUniversalForwarder\var\log\splunk\splunkd.log' -Tail 300 |
  Select-String 'Sysmon|subscribeToEvt|errorCode=5'

Fix aplicado en este PC (permanente): Añadir (A;;0x1;;;WD) (Everyone read) al SDDL del canal Sysmon:

# (admin)
$newSddl='O:BAG:SYD:(A;;0xf0007;;;SY)(A;;0x7;;;BA)(A;;0x1;;;BO)(A;;0x1;;;SO)(A;;0x1;;;S-1-5-32-573)(A;;0x1;;;WD)'
wevtutil set-log 'Microsoft-Windows-Sysmon/Operational' /ca:$newSddl

Adicionalmente, en inputs.conf stanza Sysmon:

[WinEventLog://Microsoft-Windows-Sysmon/Operational]
disabled = 0
index = win_sysmon
start_from = oldest
current_only = 0
renderXml = true
checkpointInterval = 5
evt_resolve_ad_obj = 0

(deshabilita evt_resolve_ad_obj en workgroup — ver sección 8.)

Tras esto:

  • Borrar checkpoint del UF:
    Stop-Service SplunkForwarder
    Remove-Item 'C:\Program Files\SplunkUniversalForwarder\var\lib\splunk\fishbucket\splunk_private_db\fishbucket.sqlite.db*' -Force
    Start-Service SplunkForwarder
  • Generar actividad Sysmon (inicia procesos) y esperar 90 s.
  • Verificar:
    index=win_sysmon | stats count by EventID

Verificación final (este PC, 2026-06-27):

EventIDQuéEventos recibidos
1ProcessCreate26,448
3NetworkConnection12,427
22DNS Query (SwiftOnSecurity)983
11FileCreate112
13RegistrySetValue23
5ProcessTerminate2
15FileCreateStreamHash2
2FileCreateTime6
16Sysmon config change1

8. EvtDC::bind: Failed to get domain controller name (1355)

Síntoma:

ERROR splunk-winevtlog - WinEventCommonChannel - EvtDC::bind: Failed to get domain controller name with DsGetDcName: (1355)
ERROR splunk-winevtlog - WinEventCommonChannel - EvtDC::connectToDC: DsBind failed: (1355)
ERROR splunk-winevtlog - WinEventLogChannel::init: Failed to bind to DC, dc_bind_time=0 msec

Causa: en hosts workgroup (sin dominio AD), Splunk intenta resolver SIDs vía DC y falla con 1355 (ERROR_DOMAIN_NOT_FOUND).

Fix: añadir evt_resolve_ad_obj = 0 en cada stanza WinEventLog:

[WinEventLog://Microsoft-Windows-Sysmon/Operational]
renderXml = true
evt_resolve_ad_obj = 0

No es fatal — los eventos se siguen leyendo, sólo no se resuelven SIDs a nombres de cuenta. En este PC se aplicó en stanza Sysmon.

9. evt_disable_fields Invalid key

Síntoma: al editar inputs.conf colé accidentalmente evt_disable_fields = 0. Splunk no reconoce ese key:

Invalid key in stanza [WinEventLog://Microsoft-Windows-Sysmon/Operational] in inputs.conf, line 42: evt_disable_fields (value: 0).

Fix: eliminar la línea evt_disable_fields = 0 del inputs.conf y reiniciar el UF.

10. Dónde mirar logs

RutaContenido
C:\Program Files\Splunk\var\log\splunk\splunkd.logIndexer (Splunk Enterprise)
C:\Program Files\Splunk\var\log\splunk\metrics.logMétricas de pipeline/indexer
C:\Program Files\SplunkUniversalForwarder\var\log\splunk\splunkd.logUF
C:\Program Files\SplunkUniversalForwarder\var\log\splunk\metrics.logMétricas UF (tcpout, queue, etc.)

Búsqueda de problemas en el indexer:

index=_internal sourcetype=splunkd log_level=ERROR OR log_level=WARN
| stats count by component message | sort -count

11. Estado final de los artefactos

ArchivoRutaOrigenComentario
inputs.conf (UF)...\SplunkUniversalForwarder\etc\apps\SOC-Windows-Local\local\Creado por nosotrosVer Anexo A - inputs.conf
outputs.conf (UF)...\SplunkUniversalForwarder\etc\system\local\Creado por nosotrosVer Anexo B - outputs.conf
inputs.conf (indexer)...\Splunk\etc\system\local\ModificadoSe añadió [splunktcp://9997]
indexes.conf (indexer)...\Splunk\etc\apps\SOC-Windows-Local\local\Creado por nosotrosVer Anexo C - indexes.conf
app.conf (indexer & UF)...\SOC-Windows-Local\app_confCreado por nosotrosVer Anexo D - SOC-Windows-Local app.conf
props.conf de botsv3_data_setrenombrado a .bakFixSintaxis inválida preexistente
props.conf de splunk_monitoring_consolerestaurado de .bakFixEra válido (falso positivo)

Volver a: 00 - MOC Monitorización PC Local