{"id":10611,"date":"2025-02-07T17:01:01","date_gmt":"2025-02-07T17:01:01","guid":{"rendered":"https:\/\/cheapwindowsvps.com\/blog\/a-comprehensive-guide-to-collecting-windows-and-active-directory-event-logs-using-graylog\/"},"modified":"2025-02-07T17:01:01","modified_gmt":"2025-02-07T17:01:01","slug":"a-comprehensive-guide-to-collecting-windows-and-active-directory-event-logs-using-graylog","status":"publish","type":"post","link":"https:\/\/cheapwindowsvps.com\/blog\/a-comprehensive-guide-to-collecting-windows-and-active-directory-event-logs-using-graylog\/","title":{"rendered":"A Comprehensive Guide to Collecting Windows and Active Directory Event Logs Using Graylog"},"content":{"rendered":"<p>In a previous post, we discussed deploying a centralized log collection and management service using the Graylog stack (Graylog + OpenSearch + MongoDB). This article will guide you on sending Event Viewer logs from Windows hosts, including Active Directory domain controller events, to Graylog.<\/p>\n<h2>Configuring Graylog Data Collector for Windows Devices<\/h2>\n<p>To start, navigate to <strong>System<\/strong> -&gt; <strong>Inputs<\/strong> in the Graylog interface. Add a new collector for <strong>Windows Server Devices<\/strong> with the type set to <strong>Beats<\/strong> listening on TCP port 5044. Create a separate index for Windows Event logs and establish a new Windows stream based on the new input and index.<\/p>\n<h2>Winlogbeat: Sending Windows Event Logs to Graylog<\/h2>\n<p>To send EventViewer logs from Windows hosts to the Graylog server, utilize the <strong>Winlogbeat<\/strong> log collector service, which is part of the ELK stack. Install Winlogbeat on each Windows host you wish to monitor.<\/p>\n<ol>\n<li>Download the Winlogbeat archive from the <a target=\"_blank\" rel=\"nofollow noopener\" href=\"https:\/\/www.elastic.co\/downloads\/beats\/winlogbeat\">download page<\/a>.<\/li>\n<li>Extract the contents to <code>C:Program Fileswinlogbeat<\/code>.<\/li>\n<li>Edit the <strong>winlogbeat.yml<\/strong> configuration file.<\/li>\n<\/ol>\n<p>In its simplest form, your configuration should send events from the Application, Security, and System Event logs:<\/p>\n<pre><code class=\"language-yaml\">winlogbeat.event_logs:  - name: Application    ignore_older: 72h  - name: Security  - name: Systemoutput.logstash:  hosts: [&quot;192.168.14.146:5044&quot;]<\/code><\/pre>\n<p>For more specific logging, you can configure it to collect selected events based on severity levels and EventIDs. After editing the configuration, verify its correctness and ensure the log collector service is running.<\/p>\n<pre><code class=\"language-powershell\">cd &quot;C:Program Fileswinlogbeat&quot;.winlogbeat test config.winlogbeat test output<\/code><\/pre>\n<p>If successful, install and start the Winlogbeat service:<\/p>\n<pre><code class=\"language-powershell\">.install-service-winlogbeat.ps1Start-Service winlogbeat<\/code><\/pre>\n<p>Check the Graylog web interface to confirm that your Windows server logs are appearing in the designated stream.<\/p>\n<h2>Collect Active Directory Domain Controller Event Logs with Graylog<\/h2>\n<p>Graylog allows you to search and analyze Windows events effectively with Active Directory as an example. If multiple domain controllers exist, the centralized log collector simplifies the process of identifying specific events.<\/p>\n<p>To find out, for instance, which computer locked a user account due to incorrect password attempts, you can run a query in Graylog:<\/p>\n<pre><code class=\"language-plaintext\">winlogbeat_event_code:(4740 OR 4625) AND winlogbeat_event_provider:Microsoft-Windows-Security-Auditing<\/code><\/pre>\n<p>This centralized logging helps in quickly identifying significant events like user password resets or account creations using specific EventIDs, such as:<\/p>\n<ul>\n<li><strong>Event ID 4767<\/strong> &#8211; identifies who unlocked an AD user.<\/li>\n<li><strong>Event ID 4724<\/strong> &#8211; tracks who reset a domain user&#8217;s password.<\/li>\n<\/ul>\n<p>Make sure Winlogbeat agents are set up on each Domain Controller. Certain Active Directory security events require enabling in the Audit Policy settings.<\/p>\n<h2>Centralizing Event Logging for Windows Hosts<\/h2>\n<p>With Graylog, you can conveniently collect and analyze logs from various Windows Server services. Consider scenarios for auditing files and folders, tracking deletions, monitoring Remote Desktop connections, and recognizing system shutdown activities.<\/p>\n<p>Graylog\u2019s architecture makes it simple to manage Windows event logs and critical IDs that require monitoring. For more details on specific events and monitoring, you can refer to the <a target=\"_blank\" rel=\"nofollow noopener\" href=\"https:\/\/graylog.org\/post\/critical-windows-event-ids-to-monitor\/\">Graylog documentation<\/a>.<\/p>\n<p>Utilizing centralized storage for Windows and Active Directory event logs significantly enhances your ability to investigate security incidents, analyze events, and troubleshoot issues efficiently.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In a previous post, we discussed deploying a centralized log collection and management service using the Graylog stack (Graylog + OpenSearch + MongoDB). This article will guide you on sending Event Viewer logs from Windows hosts, including Active Directory domain controller events, to Graylog. Configuring Graylog Data Collector for Windows Devices To start, navigate to [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":10612,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[97,108],"tags":[],"class_list":["post-10611","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-active-directory","category-windows-server-2022"],"_links":{"self":[{"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/posts\/10611","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/comments?post=10611"}],"version-history":[{"count":0,"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/posts\/10611\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/media\/10612"}],"wp:attachment":[{"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/media?parent=10611"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/categories?post=10611"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cheapwindowsvps.com\/blog\/wp-json\/wp\/v2\/tags?post=10611"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}