Process group log monitoring API - POST analysis job

Starts the log analysis job.

Optionally, you can specify the timeframe of analysis, by providing the start and the end time stamp. You can also specify a query to filter log content.

The request produces an application/json payload.

POST
  • Managed https://{your-domain}/e/{your-environment-id}/api/v1/entity/infrastructure/process-groups/{pgId}/logs/{logPath}
  • SaaS https://{your-environment-id}.live.dynatrace.com/api/v1/entity/infrastructure/process-groups/{pgId}/logs/{logPath}

Parameters

Note All special characters in the log path must be escaped.

Parameter Type Description In Required
pgId string

The entity ID of the required process group.

path required
logPath string

The full pathname of the log.

path required
hostFilter string

Narrows down the scope of the analysis to process groups, running at the specified hosts.

Specify the entity ID of the required host here. To specify several IDs, separate them with a comma.

query optional
query string

Narrows down the scope of the analysis to the entries, matching the specified criteria.

The criteria must use the Dynatrace search query language syntax.

query optional
startTimestamp integer

The start timestamp of the analysis range, in UTC milliseconds.

If not set, then 2 hours behind from now is used.

query optional
endTimestamp integer

The end timestamp of the analysis range, in UTC milliseconds.

If not set, then the current timestamp is used.

query optional
body ParsingDefinition

Parsing definition to specify other parsing criteria.

body optional

The ParsingDefinition object

Element Type Description Required
parsingMode string

Parsing mode for log analysis entries presentation. Available parsing modes: [json, disabled, all]

optional
customParsingFields CustomParsingField[]

Custom parsing fields.

optional

The CustomParsingField object

Element Type Description Required
name string

Custom field name.

optional
valueType string

Custom field type. Available field types: [string, integer, long, float, boolean]

optional
contentPrefix string

Content prefix.

optional
contentSuffix string

Content suffix.

optional

Response format

Element Type Description
jobId string The ID of the started job.

Response codes

Code Description
202 Success. The response body contains the ID of the job.
400 Failed. See response body for details
404 Not found. See response body for details

Example

In this example the request starts a log analysis job for the logs/Fvar/Flog/Fsyslog log of the PROCESS_GROUP-54A8B0B75D36E463 process group. The timeframe of analysis lies between timestamps 1470300000000 and 1470360000000.

The API token is passed in the Authorization header.

The response contains the ID of the started analysis job.

Curl

curl -X POST \
  https://mySampleEnv.live.dynatrace.com/api/v1/entity/infrastructure/process-groups/PROCESS_GROUP-54A8B0B75D36E463/logs/%2Fvar%2Flog%2Fsyslog?startTimestamp=1470300000000&endTimestamp=1470360000000 \
  -H 'Authorization: Api-Token abcdefjhij1234567890' \  

Request URL

https://mySampleEnv.live.dynatrace.com/api/v1/entity/infrastructure/process-groups/PROCESS_GROUP-54A8B0B75D36E463/logs/%2Fvar%2Flog%2Fsyslog?startTimestamp=1470300000000&endTimestamp=1470360000000

Response content

{
	"jobId":"707306f2-f3c2-4f7b-a457-cf00f7a65b1d"
}

Response code

202