How do I fetch the list of logs?

You can get the log list based on host ID or on process group. The list of logs based on host ID are operating system logs of provided host and the log list based on process group lists all logs associated with provided process group.

GET log list

A call to the entity/infrastructure/hosts/<hostId>/logs endpoint returns a list of operating system logs on indicated host.

GET
  • Managed https://{your-domain}/e/{your-environment-id}/api/v1/entity/infrastructure/hosts/<hostId>/logs
  • SaaS https://{your-environment-id}.live.dynatrace.com/api/v1/entity/infrastructure/hosts/<hostId>/logs

A call to the entity/infrastructure/process-groups/<pgId>/logs endpoint returns a list of logs of indicated process group.

GET
  • Managed 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

Once you execute the call, the following status codes indicate the success or failure of the call:

  • 200 - OK
    • Successful execution of the call
  • 400 - Bad Request
    • Wrong hostId or pgId parameter (provided hostId or pgId is invalid)
  • 404 - Not Found
    • Provided hostId or pgId was not found.