Host logs API v1 - POST top log content

Gets the content of the specified log.

The log content can be retrieved using this call only when logAnalysisStatus equals READY in the job status call.

The request produces an application/json payload.

  • Managed https://{your-domain}/e/{your-environment-id}/api/v1/entity/infrastructure/hosts/{hostId}/logs/jobs/{jobId}/records/top
  • SaaS https://{your-environment-id}{hostId}/logs/jobs/{jobId}/records/top
  • Environment ActiveGate https://{your-activegate-domain}/e/{your-environment-id}/api/v1/entity/infrastructure/hosts/{hostId}/logs/jobs/{jobId}/records/top


To execute this request, you need the Read logs (LogExport) permission assigned to your API token. To learn how to obtain and use it, see Tokens and authentication.


Parameter Type Description In Required
hostId string

The Dynatrace entity ID of the required host.

path required
jobId string

The ID of the required log analysis job.

You can retrieve it from the response of the POST analysis job request.

path required
body FilterTopLogRecords

Filter the log content by the specified criteria.

See Search patterns in log data and parse results in Dynatrace Documentation for the syntax definition and examples.

body optional

Body format

The FilterTopLogRecords object

A query to filter top log records.

Element Type Description Required
filterQuery string

The query for filtering.

See Search patterns in log data and parse results in Dynatrace Documentation page for syntax description.



When scrolling through the result records using a scroll token, the last result page contains an empty records array and no scrollToken field.

Response codes

Code Description



Failed. See the response body for details

Response body

The LogJobRecordsTopValuesRestResult object

The top values results of the log analysis job.

Element Type Description
parsingFieldTopValues ParsingFieldTopValue[]

Log analysis parsing result top values

valuesCount integer

Log analysis parsing result top values count

The ParsingFieldTopValue object

Element Type Description
fieldName string

Top value parsing field name

occurrences Occurrence[]

Top value parsing field occurrences

The Occurrence object

Element Type Description
value string

Value of top parsing field occurrence

count integer

Count of top parsing field occurrences