Better Stack Datadog Agent logging

Start logging in 2 minutes

Do you already have Datadog Agent installed?

Adjust already installed Datadog Agent

1. Set up metrics forwarding

Set up your Datadog Agent to send metrics to both Datadog and Better Stack. Change your /etc/datadog-agent/datadog.yaml configuration file or set up environment variable:

YAML config ENV variables
additional_endpoints:
  "https://in-datadog.logs.betterstack.com":
    - "$SOURCE_TOKEN"
DD_ADDITIONAL_ENDPOINTS='{"https://in-datadog.logs.betterstack.com": ["$SOURCE_TOKEN"]}'

2. Set up logs forwarding (optional)

Using Datadog Agent to process logs?

Set up log forwarding to both Datadog and Better Stack. Change your /etc/datadog-agent/datadog.yaml configuration file or set up environment variables:

YAML config ENV variables
logs_enabled: true
logs_config:
  use_http: true
  additional_endpoints:
    - Host: "in-datadog.logs.betterstack.com"
      Port: 443
      api_key: "$SOURCE_TOKEN"
      is_reliable: true
DD_LOGS_ENABLED=true
DD_LOGS_CONFIG_USE_HTTP=true
DD_LOGS_CONFIG_ADDITIONAL_ENDPOINTS='[{"Host": "in-datadog.logs.betterstack.com", "Port": 443, "api_key": "$SOURCE_TOKEN", "is_reliable": true}]'

3. Restart Datadog Agent

Restart Datadog Agent for the new configuration to take effect:

Ubuntu, Debian CentOS, Red Hat
sudo service datadog-agent restart
sudo systemctl restart datadog-agent

If you set up logs, you should see them in Better Stack → Live tail .

Check out your metrics in the Datadog Agent dashboard .

Install Datadog Agent and send data to Better Stack

Are you starting with logging and monitoring from scratch?

Use Vector for the best experience with Better Stack.

1. Install Datadog Agent

Install and set up Datadog Agent  on your machine:

Install Datadog Agent
DD_URL="https://in-datadog.logs.betterstack.com" \
DD_API_KEY="$SOURCE_TOKEN" \
DD_HOSTNAME="$(hostname)" \
bash -c "$(curl -L https://s3.amazonaws.com/dd-agent/scripts/install_script_agent7.sh)"

You should see your metrics in the Datadog Agent dashboard .

2. Set up sending logs (optional)

Want to send logs to Better Stack using Datadog Agent?

Enable and configure your logging according to official Datadog documentation . For example, create new agent configuration  in /etc/datadog-agent/conf.d/system.d/conf.yaml to start sending your system logs:

Create new agent configuration
mkdir -p /etc/datadog-agent/conf.d/system.d
cat > /etc/datadog-agent/conf.d/system.d/conf.yaml << YAML
logs:
  - type: file
    path: "/var/log/*.log"
    service: "mysystem"
    source: "system"
  - type: file
    path: "/var/log/*/*.log"
    service: "mysystem"
    source: "system"
YAML

Change the logs URL in /etc/datadog-agent/datadog.yaml and enable them:

Configure sending logs
cat >> /etc/datadog-agent/datadog.yaml << YAML

logs_enabled: true
logs_config:
  logs_dd_url: "https://in-datadog.logs.betterstack.com"
  force_use_http: true
YAML

Restart Datadog Agent for the new configuration to take effect:

Ubuntu, Debian CentOS, Red Hat
sudo service datadog-agent restart
sudo systemctl restart datadog-agent

You should see your logs in Better Stack → Live tail .

Check out your metrics in the Datadog Agent dashboard .

Need help?

Please let us know at hello@betterstack.com.
We're happy to help! 🙏

Additional information

To help you locate your main configuration file, see Datadog Agent configuration files docs .

Want to read about Datadog Agent data forwarding in more detail?
Check out the Datadog Agent dual shipping page .