# Troubleshooting log Ingestion via API - POST ingest logs

**URL:** <https://community.dynatrace.com/t/troubleshooting-log-ingestion-via-api-post-ingest-logs/53456>\
**Category:** Troubleshooting\
**Tags:** log-analytics, log-ingestion, grail, log-monitoring-class\
**Created:** [September 24, 2025, 1:40pm UTC](https://community.dynatrace.com/t/troubleshooting-log-ingestion-via-api-post-ingest-logs/53456 "2025-09-24T13:40:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![noel\_david](https://avatars.discourse-cdn.com/v4/letter/n/3ec8ea/32.png) [@noel\_david](https://community.dynatrace.com/u/noel_david)\
**Post date:** [September 24, 2025, 1:40pm UTC](https://community.dynatrace.com/t/troubleshooting-log-ingestion-via-api-post-ingest-logs/53456/1 "2025-09-24T13:40:37Z")

</div>

# Summary

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

# Troubleshooting steps

## 1.&nbsp; **Verify API Endpoint**

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

## 2.&nbsp; **Check Authentication**

- Ensure your access token includes the&nbsp;`logs.ingest`&nbsp;scope.
- Validate token format and expiration.

## 

3.&nbsp; **Validate Headers**

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

## 

4.&nbsp; **Inspect Payload Format**

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

## 

5.&nbsp; **Check Timestamp Validity**

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

## 

6.&nbsp; **Review Attribute Depth**

- Limit nesting to 5 levels.
- Avoid conflicting keys (Dynatrace will prefix with&nbsp;`overwritten1`, etc.).

## 

7.&nbsp; **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 Required`:&nbsp;Failed. This is due either to the status of your licensing agreement or because you’ve exhausted your&nbsp;[DPS license](https://www.dynatrace.com/support/help/shortlink/dynatrace-platform-subscription).
- `403 Forbidden`: The token lacks the proper permissions
- `404 Not Found`:&nbsp;Failed. 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.&nbsp;**Enable Semantic Attributes (Optional)**

- Use attributes like&nbsp;`host.name`,&nbsp;`http.status_code`,&nbsp;`dt.entity.service`&nbsp;for enhanced querying.

# **Limitations**

Please refer to the following documentation pages:

- [Grail tenant limits](https://docs.dynatrace.com/docs/analyze-explore-automate/logs/lma-limits)
- [LM v2 SaaS tenant limits](https://docs.dynatrace.com/docs/analyze-explore-automate/log-monitoring/log-monitoring-limits)
- [LM v2 Managed tenant limits](https://docs.dynatrace.com/managed/analyze-explore-automate/log-monitoring/log-monitoring-limits)

# 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:

- Link to tenant
- API endpoint used
- Responses to ingest requests including response codes and messages

# More articles can be found on the

**[Logs Troubleshooting Map](https://community.dynatrace.com/topic/302260)**
