Skip to main content
This guide shows how to configure audit log streaming from a GitHub Enterprise account to a third‑party observability provider (Datadog in this demo). It covers where to find audit events in GitHub, how to configure a stream, generating an API key in the destination, quick methods to generate test events, and what the streamed events look like in Datadog. Quick example audit entries you might see in the GitHub audit UI:

What you can stream and why

GitHub Enterprise audit logs capture actions taken by users and administrators across organizations and repositories (authentication events, repository changes, security configuration, token authorization, etc.). Streaming these events into your existing observability stack lets you:
  • Centralize monitoring and retention
  • Build alerts and dashboards for suspicious activity
  • Correlate GitHub activity with other telemetry
GitHub supports several audit-log destinations:
A dark-themed GitHub Enterprise settings screen for the organization "NextGen Gaming," showing the Audit log → Log streaming tab with the "Configure stream" dropdown open and "Azure Event Hubs" highlighted. The left sidebar lists settings items like Authentication security, Hooks, and GitHub Apps.

Setup overview (Datadog example)

This demo uses Datadog as the log destination. High-level steps:
  1. In Datadog: create an API key for GitHub logs and note your Datadog endpoint/region.
  2. In GitHub Enterprise: navigate to Enterprise settings → Audit log → Log streaming → Configure stream → choose Datadog, paste the API key, and set the Datadog site/region.
  3. Validate the connection and Save. GitHub will validate the token and endpoint during setup.
  4. Wait for events to flow (initial propagation usually takes minutes); verify in Datadog Logs Explorer.
To create the Datadog API key:
  • In Datadog: Integrations → APIs (API Keys) → New API key
  • Name the key (e.g., “GitHub Logs”), copy the key, and paste into GitHub’s Datadog configuration.
A screenshot of the Datadog web UI with a "New API Key" popup showing a masked key and a "Copied to clipboard!" tooltip. The API Keys settings page and left navigation menu are visible in the background.
Keep API keys and tokens private. Treat Datadog API keys like secrets: rotate them periodically and avoid embedding them in public or shared code repositories.
After successful validation and save, the stream appears active in GitHub Enterprise and you can pause/edit/delete it from the same UI.
A screenshot of a GitHub Enterprise "Audit log" settings page for the NextGen Gaming org, showing an active audit log stream configured to Datadog with options to Edit, Pause stream, or Delete stream. The left sidebar displays other settings like Authentication security, Hooks, and GitHub Apps.
For provider-specific instructions (fields to fill, where to generate tokens, and endpoint mappings), follow the GitHub Docs for streaming the audit log and the provider’s guide.
A dark-themed screenshot of a GitHub Docs page titled "Streaming the audit log for your enterprise," showing guidance text about streaming audit and Git events and a right-hand table of contents. The page includes a note about webhooks and sections about audit log streaming.
A dark-themed screenshot of a GitHub Docs page titled "Setting up streaming to Datadog," showing numbered step-by-step instructions and links. The browser window also shows multiple open tabs and a right-hand table of contents.
After saving a new stream, expect a short propagation delay: typically 10–15 minutes for the first events to appear in your destination (Datadog in this demo). Delays vary with event volume and service propagation.

Verifying events in Datadog

Open Datadog Logs Explorer. If you recently enabled streaming, you may initially see no results until the first events arrive.
A screenshot of the Datadog Log Explorer web UI showing no matching log results and a Watchdog Insights panel reporting no detected insights. The left navigation, search/filter controls, and time range toolbar are also visible.
If nothing appears after a reasonable wait, double-check:
  • The API key is correct and active.
  • The Datadog site/region matches the endpoint you specified (for example, use ap1.datadoghq.com for AP1).
  • The GitHub stream shows a successful validation in the UI.
  • Time range filters in Datadog are set to include the period when you generated events.

Generating test audit events quickly

To surface events for a demo or validation, perform non-destructive configuration changes in the enterprise:
  • Toggle organization- or repository-level security settings (for example, Advanced Security options).
  • Create a test repository, change visibility, and perform repository actions (create branches, update settings, etc.).
  • Trigger security scans (secret scanning, Dependabot alerts) if enabled.
Examples from this demo:
  • Created TestReport2 / test-repo-2
  • Changed repository visibility (internal → public)
  • Toggled Advanced Security settings
Repository page used when creating the test repo:
A screenshot of a GitHub repository page (ghas-guardrail-demo) in dark mode showing the repository’s file list, branch (main), and recent commits. The right sidebar displays About, Releases, and Deployments information.
Changing visibility via the repository settings Danger Zone (confirmation modal):
A dark-mode screenshot of a GitHub repository settings page showing the Issues section and the Danger Zone. A centered modal prompts "Make game-devstudio/test-repo-2 public" with a red "Make this repository public" button.
You can also request a manual export (JSON or CSV). When you request an export, GitHub creates an export job — large exports may take up to an hour, smaller tests complete faster. Some events (secret scanning alerts, repository security configuration changes, visibility changes) appear in the enterprise audit log UI:
A dark-themed screenshot of a GitHub audit log showing entries for secret scanning and repository security configuration applied to a repository (game-devstudio/test-repo-2). The panel displays event details and metadata such as timestamps, actor info, and configuration names.

Example of a streamed event (Datadog)

When the stream is active, GitHub forwards events to Datadog as structured logs. A typical event includes actor information, action, repository, organization, timestamps, and user-agent metadata. Example stream data:
Datadog Logs Explorer showing GitHub audit entries:
A screenshot of the Datadog Logs Explorer showing many GitHub audit log entries with timestamps and JSON fields in the main list. The Datadog navigation sidebar and a small timeline graph are visible at the top and left.

Troubleshooting checklist

  • Confirm stream status in GitHub Enterprise UI. Look for validation success when saving.
  • Verify Datadog API key and platform site/region (e.g., datadoghq.com, datadoghq.eu, ap1.datadoghq.com).
  • Ensure time range filters and saved views in Datadog include the test timeframe.
  • For exports, check export job status in GitHub (exports may take longer depending on volume).
  • Consult GitHub Docs and the provider’s integration docs for specifics.
Summary: configure a log stream in GitHub Enterprise, provide the destination credentials and region (Datadog API key and site in this demo), validate and save the stream, then verify events arriving in your observability tool to build alerts and dashboards.

Watch Video