2‐Datadog_Agent On Windows Servers - harishgorla5/HINTechnologies_datadog GitHub Wiki

🖥️ Install Datadog Agent on Windows & Collect Logs

This guide explains how to install the Datadog Agent on a Windows machine and configure it to collect logs.


📥 Step 1: Download the Windows Agent

  1. Visit the official download link:
    👉 https://app.datadoghq.com/account/settings#agent
  2. Choose "Windows" and download the .msi installer.

💾 Step 2: Install the Agent

Run the installer and follow the prompts:

  • During installation, provide your Datadog API Key
  • Choose the correct Datadog Site (e.g., us5.datadoghq.com)
  • Complete the installation

The Agent will run as a Windows service named:
➡️ DatadogAgent


📝 Step 3: Enable Log Collection

  1. Open the Agent configuration directory:
    C:\ProgramData\Datadog\conf.d

  2. Edit the global agent config file:
    C:\ProgramData\Datadog\datadog.yaml

  3. Add/ensure the following lines are present:

logs_enabled: true
log_level: INFO
  1. Save the file and restart the Agent:
Restart-Service datadogagent

🗂️ Step 4: Configure Log Files to Monitor

To monitor specific log files (e.g., IIS, custom apps):

  1. Go to:
    C:\ProgramData\Datadog\conf.d\

  2. Create or modify an integration config folder, for example:

For custom logs:

Create a file:
custom_logs.d\conf.yaml

logs:
  - type: file
    path: C:\logs\myapp.log
    service: myapp
    source: custom

📁 Make sure the log file exists and is being written to.

  1. Restart the Datadog Agent again:
Restart-Service datadogagent

🔍 Step 5: Verify Log Collection

  1. Go to the Datadog UI:

    • Navigate to: Logs → Live Tail
    • Filter by service:myapp or source:custom
  2. Run the agent status command in PowerShell:

"C:\Program Files\Datadog\Datadog Agent\bin\agent.exe" status

Look under the Log section for successful log collection.


✅ Example: Enable IIS Logs

If you're running IIS, use:

logs:
  - type: file
    path: C:\inetpub\logs\LogFiles\W3SVC1\u_ex*.log
    service: iis
    source: iis

🧪 Troubleshooting Tips

  • Check Agent logs:
    C:\ProgramData\Datadog\logs\agent.log

  • Validate your API key at:
    https://app.datadoghq.com/organization-settings/api-keys

  • Confirm network access to *.datadoghq.com over HTTPS


📎 Useful Links


Let me know if you want this guide extended for:

  • Docker container logs on Windows
  • IIS app-pool monitoring
  • Event Logs (e.g., Application/System)