What does the Log Analytics API provide?

By default, the Log Analytics API is enabled only for upgraded Log Analytics tenants and for all its sub types for example, a upgraded Log Analytics tenant without storage enabled. To use API, you have to generate API token with action Access logs. For generating API token and setting up authentication, please visit How do I set up authentication to use the Dynatrace API?

Using the Log Analytics API you can:

  • Get the log list based on host ID or on process group.

  • Start a log retrieval job based on host ID or on process group.
    Optionally, you can indicate the start and end timestamp as well as a query to filter any log content.

  • Get the status of a log retrieval job based on host ID or on process group.

  • Get the content of a log based on host ID or on process group.

  • Delete or cancel a log retrieval job based on host ID or on process group.

The following example is a typical sequence of API calls that uses the host ID as a main parameter and all API actions are limited to logs on that specified host. The same API calls can be made using a process group ID, in which case the logs can be dispersed on multiple hosts.

Fetch the list of logs. For details on this API call, see How do I fetch the list of logs?

Start a log retrieval job. For details on this API call, see How do I start a log retrieval job?

Get the status of a log retrieval job. For details on this API call, see How do I get the status of a log retrieval job?

Get the content of a log. For details on this API call, see How do I get the content of a log?

Delete or cancel log retrieval job. For details on this API call, see How do I delete or cancel log retrieval job?