Process group logs API v1 - GET logs
deprecated
This API is deprecated.
- For Log monitoring - Custom devices, Hosts, or Process Groups, what to use instead depends on which version of Log Monitoring you use:
- Log Management and Analytics: Grail Query API
- Log Monitoring Classic: Log Monitoring API
- For Calculated metrics - Log Monitoring, use the Settings API endpoint with schemaId
builtin:logmonitoring.schemaless-log-metric
.
Lists all the available OS logs on the specified process group.
The request produces an application/json
payload.
GET | ManagedDynatrace for Government | 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}:9999/e/{your-environment-id}/api/v1/entity/infrastructure/process-groups/{pgId}/logs |
Authentication
To execute this request, you need an access token with LogExport
scope.
To learn how to obtain and use it, see Tokens and authentication.
Parameters
Parameter | Type | Description | In | Required |
---|---|---|---|---|
pgId | string | The entity ID of the process group. | path | required |
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
Code | Type | Description |
---|---|---|
200 | LogList4pgResult | Success |
400 | ErrorEnvelope | Failed. See the response body for details |
4XX | ErrorEnvelope | Client side error. |
5XX | ErrorEnvelope | Server side error. |
Response body objects
The LogList4pgResult
object
The list of available process group logs.
Element | Type | Description |
---|---|---|
logs | LogFile4pg[] | The list of available process group logs. |
The LogFile4pg
object
Element | Type | Description |
---|---|---|
hosts | Host4pg[] | The distribution of the process group log across hosts. |
path | string | The full path to the log. |
size | integer | The size of the log, bytes |
The Host4pg
object
The process group log on the host.
Element | Type | Description |
---|---|---|
availableForAnalysis | boolean | The log is available (true) or not available (false) for analysis. |
contentAccess | boolean | The access to the log content is granted (true) or denied (false). |
hostId | string | The entity ID of the host. |
logSize | integer | The size of the PG log for the host, bytes. |
Response body JSON model
{"logs": [{"hosts": [{"availableForAnalysis": true,"contentAccess": true,"hostId": "string","logSize": 1}],"path": "string","size": 1}]}
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
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
https://mySampleEnv.live.dynatrace.com/api/v1/entity/infrastructure/process-groups/PROCESS_GROUP-54A8B0B75D36E463/logs
Response content
{"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