POST
/
v1
/
auditLogs:search
{
  "auditLogs": [
    {
      "name": "<string>",
      "createTime": "2023-11-07T05:31:56Z",
      "user": "<string>",
      "method": "<string>",
      "severity": "DEFAULT",
      "resource": "<string>",
      "request": "<string>",
      "response": "<string>",
      "status": {
        "code": 123,
        "message": "<string>",
        "details": [
          {
            "@type": "<string>"
          }
        ]
      },
      "latency": "<string>",
      "serviceData": {
        "@type": "<string>"
      },
      "requestMetadata": {
        "callerIp": "<string>",
        "callerSuppliedUserAgent": "<string>"
      }
    }
  ],
  "nextPageToken": "<string>"
}

Body

application/json
parent
string
required
filter
string

The filter of the log. It should be a valid CEL expression. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

Supported filter:

  • method: the API name, can be found in the docs, should start with "/bytebase.v1." prefix. For example "/bytebase.v1.UserService/CreateUser". Support "==" operator.
  • severity: support "==" operator, check Severity enum in AuditLog message for values.
  • user: the actor, should in "users/{email}" format, support "==" operator.
  • create_time: support ">=" and "<=" operator.

For example:

  • filter = "method == '/bytebase.v1.SQLService/Query'"
  • filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR'"
  • filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR' && user == 'users/bb@bytebase.com'"
  • filter = "method == '/bytebase.v1.SQLService/Query' && severity == 'ERROR' && create_time <= '2021-01-01T00:00:00Z' && create_time >= '2020-01-01T00:00:00Z'"
orderBy
string

The order by of the log. Only support order by create_time. For example:

  • order_by = "create_time asc"
  • order_by = "create_time desc"
pageSize
integer

The maximum number of logs to return. The service may return fewer than this value. If unspecified, at most 10 log entries will be returned. The maximum value is 5000; values above 5000 will be coerced to 5000.

pageToken
string

A page token, received from a previous SearchLogs call. Provide this to retrieve the subsequent page.

Response

OK

auditLogs
object[]
nextPageToken
string

A token to retrieve next page of log entities. Pass this value in the page_token field in the subsequent call to retrieve the next page of log entities.