Get service logs

Return the pattern manager service logs

GET /v1/admin/log

Description

Return the pattern manager service logs in one of three formats. The format returned is based on the value of the Accept HTTP header, with application/json being the default response format.

This request requires the pattern manager admin token. The following table lists the accept HTP header options:

Accept Header Value Description
application/json Filtered service log entries in JSON format
application/gzip All service logs in a tar.gz file
application/zip All service logs in a zip file
text/plain The latest service log file

Parameters

These parameters are only valid when requesting a response in JSON format. If no parameters are specified, then the last 5000 entries in the service log file will be returned.

The following table lists the parameters that are used to filter service log entries returned in JSON response:

Table 2.
Type Name Description Schema Default Required
Body contains Returns all log entries that contain the specified value String No
Body end_dts Date timestamp to end log entries collections. Accepted formats include YYYY-mm-dd HH:MM:SS,fff, YYYY-mm-dd HH:MM:SS, and YYYY-mm-dd String No
Body levels List of logging levels to include: CRITICAL, ERROR, WARNING, INFO, and DEBUG Array No
Body request_id Returns entries associated with a specific request ID. Can be used to narrow logs down to a single request train String No
Body remote List of properties to remove from the JSON response including body, dts, level and request_id Array No
Body start_dts Date timestamp to start log entries collections. Accepted formats include YYYY-mm-dd HH:MM:SS,fff, YYYY-mm-dd HH:MM:SS, and YYYY-mm-dd String No

Example Request

Header: Authorization = Bearer $ADMIN_TOKEN

{
    "contains": "/v1/info/chef",
    "levels": ["DEBUG"],
    "start_dts": "2017-08-03 14:50:10"
}

Responses

The following table lists the API responses:

HTTP Code Description Schema
200 Returns the requested pattern manager service log entries
403 The requester has not specified the correct admin token in the Authorization HTTP header.
500 An internal error occurred while processing the request.

Example Response

The following block is an example of a successful response in JSON format.

{
  log: [
    {
      body: "API response: Status = 200. Data log suppressed******* '/v1/info/chef GET ",
      dts: "2017-08-03 14:50:10,800",
      level: "DEBUG",
      request_id: "73fdad0f5f4d43829da05ad245e168da"
    },
    {
      body: "******* '/v1/info/chef GETExecuting cmd --> cd /tmp/tmpgkDyxz; knife ssl fetch ",
      dts: "2017-08-03 14:50:19,286",
      level: "DEBUG",
      request_id: "f7609ed9232548698c1f7c3c82dac9e7"
    }
  ]
}