cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
noel_david
Dynatrace Organizer
Dynatrace Organizer

 

Summary

This guide covers how to push custom logs to Dynatrace using the Log Monitoring API (POST /logs/ingest). It applies to both SaaS environments and ActiveGate deployments with the Log Analytics Collector module enabled.

 

Troubleshooting steps

 

1. Verify API Endpoint

  • Confirm you're using the correct endpoint:
  • SaaS: https://{environmentid}.live.dynatrace.com/api/v2/logs/ingest
  • ActiveGate: https://{your-activegate-domain}:9999/e/{your-environment-id}/api/v2/logs/ingest

2. Check Authentication

  • Ensure your access token includes the logs.ingest scope.
  • Validate token format and expiration.


3. Validate Headers

  • Authorization: Api-Token {your-token}
  • Content-Type: Must be one of:
    • text/plain
    • application/json
    • application/jsonl
    • application/x-ndjson


4. Inspect Payload Format

  • Confirm UTF-8 encoding.
  • For JSON payloads:
    • Use an array of log objects.
    • Include required fields like content, timestamp, and severity.
    • Flatten nested attributes using dot notation.


5. Check Timestamp Validity

  • Ensure timestamps are:
    • In UTC
    • RFC3339 or RFC3164 format
    • Not older than 24 hours


6. Review Attribute Depth

  • Limit nesting to 5 levels.
  • Avoid conflicting keys (Dynatrace will prefix with overwritten1, etc.).


7. Monitor Response Codes

  •  200 OK: Success (some logs may be dropped)
  • 204 No Content: Success
  • 400 Bad Request: Check payload structure
  • 401 Unauthorized: The token is invalid
  • 402 Payment RequiredFailed. This is due either to the status of your licensing agreement or because you've exhausted your DPS license.
  • 403 Forbidden: The token lacks the proper permissions
  • 404 Not FoundFailed. The requested resource doesn't exist. This may happen when no ActiveGate is available with the Log Analytics Collector module enabled.
  • 413 Payload Too Large: Reduce payload size
  • 429 Too Many Requests: Apply exponential backoff
  • 503 Service Unavailable: Retry later


8. Enable Semantic Attributes (Optional)

  • Use attributes like host.name, http.status_code, dt.entity.service for enhanced querying.

 

Limitations

Please refer to the following documentation pages:

 

What's next

If this article did not help, please open a support ticket, mention that this article was used and provide the following information:

 

Version history
Last update:
‎29 Sep 2025 10:26 AM
Updated by: