• Home
  • Dynatrace API
  • Environment
  • Log Monitoring v1
  • Process groups
  • POST top log content

Process group 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.

POSTManaged https://{your-domain}/e/{your-environment-id}/api/v1/entity/infrastructure/process-groups/{pgId}/logs/jobs/{jobId}/records/top
SaaS https://{your-environment-id}.live.dynatrace.com/api/v1/entity/infrastructure/process-groups/{pgId}/logs/jobs/{jobId}/records/top
Environment ActiveGate https://{your-activegate-domain}/e/{your-environment-id}/api/v1/entity/infrastructure/process-groups/{pgId}/logs/jobs/{jobId}/records/top

Authentication

To execute this request, you need an access token with Read logs (LogExport) scope. To learn how to obtain and use it, see Tokens and authentication.

Parameters

ParameterTypeDescriptionInRequired
pgIdstring

The Dynatrace entity ID of the required process group.

pathrequired
jobIdstring

The ID of the required log analysis job.

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

pathrequired
bodyFilterTopLogRecords

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.

bodyoptional

Request body objects

The FilterTopLogRecords object

A query to filter top log records.

ElementTypeDescription
filterQuerystring

The query for filtering.

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

Can be null.

Request body JSON model

This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.

json
{ "filterQuery": "`testCustomField` = 4624" }

Response

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

CodeTypeDescription
200LogJobRecordsTopValuesRestResult

Success

400ErrorEnvelope

Failed. See the response body for details

Response body objects

The LogJobRecordsTopValuesRestResult object

The top values results of the log analysis job.

ElementTypeDescription
parsingFieldTopValuesParsingFieldTopValue[]

Log analysis parsing result top values

Can be null.

valuesCountinteger

Log analysis parsing result top values count

Can be null.

The ParsingFieldTopValue object

ElementTypeDescription
fieldNamestring

Top value parsing field name

Can be null.

occurrencesOccurrence[]

Top value parsing field occurrences

Can be null.

The Occurrence object

ElementTypeDescription
valuestring

Value of top parsing field occurrence

Can be null.

countinteger

Count of top parsing field occurrences

Can be null.

Response body JSON model

json
{ "parsingFieldTopValues": [ { "fieldName": ".Level", "occurrences": [ { "value": "INFO", "count": "100" } ] } ], "valuesCount": 1 }
Related topics
  • Log Monitoring

    Learn how to enable Log Monitoring, the insights that Log Monitoring can provide, and more.