User Tools

Site Tools


windows_event_log_в_graylog

This is an old revision of the document!


Windows Event Log в Graylog

Общая последовательность действий следующая.

1. На сервере Graylog конфигурируем Input, чтобы сервер мог принимать подключения по TCP.

2. В разделе System/Sidecars создаем новый Log Collector. Коллектор логов будет содержать шаблон для наших конфигураций. В плане структуры конфигурации можно ориентироваться на стандартный шаблон для Windows с именем winlogbeat, содержащий по умолчанию директиву, предотвращающую обработку логов старше 96 часов: ignore_older: 96h.

Если нам требуется мониторить какие-либо расширенные или более конкретные разделы логов - необходимо получить их имена. Имена для всех логов конкретной ОС Windows легко можно получить с помощью PS-команды:

 Get-WinEvent -ListLog * | Format-List -Property LogName

Если нам необходимо нечто более специфическое, можно воспользоваться средтвами фильтрации PowerShell. Получим, к примеру, все логи, содержащие “Exchange” в своем названии:

Get-WinEvent -ListLog * | Where-Object logname -like "*exchang*" | format-list -Property logname 

Пример конфига коллектора для сбора стандартных логов application, security, system + всех разделов логов Microsoft Exchange:

# Needed for Graylog
fields_under_root: true
fields.collector_node_id: ${sidecar.nodeName}
fields.gl2_source_collector: ${sidecar.nodeId}


output.logstash:
   hosts: ["${user.graylog_host}:5044"]
path:
  data: ${sidecar.spoolDir!"C:\\Program Files\\Graylog\\sidecar\\cache\\winlogbeat"}\data
  logs: ${sidecar.spoolDir!"C:\\Program Files\\Graylog\\sidecar"}\logs
tags:
 - windows
winlogbeat:
  event_logs:
   - name: Application
     level: critical, error
     ignore_older: 96h
   - name: System
     level: critical, error
     ignore_older: 96h
   - name: Security
     level: critical, error
     ignore_older: 96h
   - name: MSExchange Management
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-ActiveMonitoring/MaintenanceDefinition
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-ActiveMonitoring/MaintenanceResult
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-ActiveMonitoring/MonitorDefinition
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-ActiveMonitoring/MonitorResult
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-ActiveMonitoring/ProbeDefinition
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-ActiveMonitoring/ProbeResult
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-ActiveMonitoring/ResponderDefinition
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-ActiveMonitoring/ResponderResult
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-DxStoreHA/Execution
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-DxStoreHA/General
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-DxStoreHA/Performance
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-DxStoreHA/Server
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-DxStoreHA/Validation
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-ESE/Operational
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-HighAvailability/AppLogMirror
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-HighAvailability/BlockReplication
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-HighAvailability/Debug
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-HighAvailability/Monitoring
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-HighAvailability/Network
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-HighAvailability/Operational
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-HighAvailability/Seeding
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-HighAvailability/TruncationDebug
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-MailboxAssistants/Debug
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-MailboxAssistants/Exception
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-MailboxAssistants/Operational
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-MailboxDatabaseFailureItems/Debug
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-MailboxDatabaseFailureItems/Operational
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-ManagedAvailability/InvokeNowRequest
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-ManagedAvailability/InvokeNowResult
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-ManagedAvailability/Monitoring
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-ManagedAvailability/RecoveryActionLogs
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-ManagedAvailability/RecoveryActionResults
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-ManagedAvailability/RemoteActionLogs
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-ManagedAvailability/StartupNotification
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-ManagedAvailability/ThrottlingConfig
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-PushNotifications/Analytics
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-PushNotifications/Client
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-PushNotifications/Debug
     level: critical, error
     ignore_older: 96h	 
   - name: Microsoft-Exchange-PushNotifications/Operational
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Exchange-Troubleshooters/Operational
     level: critical, error
     ignore_older: 96h
   - name: Microsoft-Windows-Security-ExchangeActiveSyncProvisioning/Operational
     level: critical, error
     ignore_older: 96h

Ознакомиться подробнее с принципами конфигурирования winlogbeat можно по следующей ссылке:

https://www.elastic.co/guide/en/beats/winlogbeat/current/configuration-winlogbeat-options.html

windows_event_log_в_graylog.1734687091.txt.gz · Last modified: 2024/12/20 09:31 by jp