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

Dynatrace API Query Returns Only One Log Record Despite Multiple Matches

azacharov
Observer

Hi,

I’m using the Dynatrace Log Monitoring API to fetch logs.

Still, I’m encountering an issue where the API returns only one record, even though I know multiple matching logs exist. Here’s the API request I’m using:

POST https://{environmentid}.apps.dynatrace.com/platform/storage/query/v1/query:execute

{
"query": "fetch logs | filter cid == \"13f3079f-1111-1111-1111-2f45fe2768da\" ",
"timezone": "Asia/Jerusalem",
"locale": "he_IL",
"maxResultRecords": 1000,
"maxResultBytes": 1000000,
"fetchTimeoutSeconds": 60,
"requestTimeoutMilliseconds": 1000,
"enablePreview": true,
"defaultSamplingRatio": 1000,
"defaultScanLimitGbytes": 100,
"queryOptions": null,
"filterSegments": null
}

 

The response consistently includes only one log record, but based on the filters (cid = "113f3079f-1111-1111-1111-2f45fe2768da"), I expect many more.

I confirmed via the Dynatrace UI that multiple logs meet these criteria within the expected timeframe.

 

Steps I’ve Tried

  1. Adjusted maxResultRecords to a higher value (e.g., 10,000).
  2. Explicitly added a broader timeframe using defaultTimeframeStart and defaultTimeframeEnd:

 

Questions:

  1. Could there be a limitation or sampling issue with my query?
  2. Is there something specific about the filters or query syntax that might restrict results?
  3. Are there additional fields I should include in the request to ensure all matching logs are returned?
  4. Could the issue be related to API-specific behavior, such as pagination or preview mode (enablePreview) ?
1 REPLY 1

GosiaMurawska
Community Team
Community Team

Hi, @azacharov! Have you managed to find the answer to your question? It would be great if you share it with the Community 🙂

Featured Posts