How do I get the content of a log?

You can get the content of a log based on host ID or on process group. You must provide either a host ID or a process group ID, and the job ID of the log which you want to get the content.

GET content of a log

A call to the entity/infrastructure/hosts/<hostId>/logs/jobs/<jobId>/records endpoint returns a content of given OS log on given host.

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

A call to the entity/infrastructure/process-groups/<pgId>/logs/jobs/<jobId>/records endpoint returns the content of a given log for given process group

GET
  • Managed https://{your-domain}/e/{your-environment-id}/api/v1/entity/infrastructure/process-groups/<pgId>/logs/jobs/<jobId>/records
  • SaaS https://{your-environment-id}.live.dynatrace.com/api/v1/entity/infrastructure/process-groups/<pgId>/logs/jobs/<jobId>/records

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
    • Record scope greater than 10000
    • Invalid scroll token
  • 404 - Not Found
    • Job not found