• Home
  • Dynatrace API
  • Environment
  • Log Monitoring v1
  • Process groups
  • GET logs

Process group logs API v1 - GET logs

Lists all the available OS logs on the specified process group.

The request produces an application/json payload.

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

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 entity ID of the process group.

pathrequired

Response

The result is JSON-formatted data that contains the array of objects, each representing a log.

  • For the default environment, the availableForAnalysis attribute is always set to true.
  • For upgraded Log Monitoring environments, the availableForAnalysis attribute is set to true when the stored log is ready for analysis.

Response codes

CodeTypeDescription
200LogList4pgResult

Success

400ErrorEnvelope

Failed. See the response body for details

Response body objects

The LogList4pgResult object

The list of available process group logs.

ElementTypeDescription
logsLogFile4pg[]

The list of available process group logs.

Can be null.

The LogFile4pg object

ElementTypeDescription
pathstring

The full path to the log.

Can be null.

sizeinteger

The size of the log, bytes

Can be null.

hostsHost4pg[]

The distribution of the process group log across hosts.

Can be null.

The Host4pg object

The process group log on the host.

ElementTypeDescription
hostIdstring

The entity ID of the host.

Can be null.

logSizeinteger

The size of the PG log for the host, bytes.

Can be null.

contentAccessboolean

The access to the log content is granted (true) or denied (false).

Can be null.

availableForAnalysisboolean

The log is available (true) or not available (false) for analysis.

Can be null.

Response body JSON model

json
{ "logs": [ { "path": "string", "size": 1, "hosts": [ { "hostId": "string", "logSize": 1, "contentAccess": true, "availableForAnalysis": true } ] } ] }

Example

In this example the request lists the logs for the PROCESS_GROUP-54A8B0B75D36E463 process group.

The API token is passed in the Authorization header.

The response contains logs of this process group.

Curl

shell
curl -X GET \ https://mySampleEnv.live.dynatrace.com/api/v1/entity/infrastructure/process-groups/PROCESS_GROUP-E0E2BD1773B29C26/logs \ -H 'Authorization: Api-Token dt0c01.abc123.abcdefjhij1234567890'

Request URL

plaintext
https://mySampleEnv.live.dynatrace.com/api/v1/entity/infrastructure/process-groups/PROCESS_GROUP-54A8B0B75D36E463/logs

Response content

json
{ "logs": [ { "path":"c:\\Users\\labuser\\.dynaTrace\\easyTravel 2.0.0\\easyTravel\\log\\BusinessBackend_#-#.log", "size":15798199, "hosts": [ { "hostId":"HOST-D4EC0D8F510A6F60", "logSize":10, "contentAccess":true, "availableForAnalysis":true }, { "hostId":"HOST-B66B773D12C49189", "logSize":15798189, "contentAccess":true, "availableForAnalysis":true } ] }, { "path":"c:\\Users\\labuser\\.dynaTrace\\easyTravel 2.0.0\\easyTravel\\log\\BusinessBackend.log", "size":17532565, "hosts": [ { "hostId":"HOST-D4EC0D8F510A6F60", "logSize":17532565, "contentAccess":true, "availableForAnalysis":true } ] } ] }

Response code

200

Related topics
  • Log Monitoring

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