• 沒有找到結果。

To disassociate an CMK from a log group

在文檔中 Amazon CloudWatch Logs (頁 81-86)

The following example disassociates the associated AWS KMS CMK from the specified log group.

Sample Request

POST / HTTP/1.1

Host: logs.<region>.<domain>

X-Amz-Date: <DATE>

Authorization: AWS4-HMAC-SHA256 Credential=<Credential>,

SignedHeaders=content-type;date;host;user-agent;x-amz-date;x-amz-target;x-amzn-requestid, Signature=<Signature>

"logGroupName": "my-log-group", }

Sample Response

HTTP/1.1 200 OK

x-amzn-RequestId: <RequestId>

Content-Type: application/x-amz-json-1.1 Content-Length: <PayloadSizeBytes>

Date: <Date>

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

• AWS Command Line Interface

• AWS SDK for .NET

• AWS SDK for C++

• AWS SDK for Go

• AWS SDK for Java V2

• AWS SDK for JavaScript

• AWS SDK for PHP V3

• AWS SDK for Python

See Also

• AWS SDK for Ruby V3

FilterLogEvents

FilterLogEvents

Lists log events from the specified log group. You can list all the log events or filter the results using a filter pattern, a time range, and the name of the log stream.

By default, this operation returns as many log events as can fit in 1 MB (up to 10,000 log events) or all the events found within the time range that you specify. If the results include a token, then there are more log events available, and you can get additional results by specifying the token in a subsequent call. This operation can return empty results while there are more log events available through the token.

The returned log events are sorted by event timestamp, the timestamp when the event was ingested by CloudWatch Logs, and the ID of the PutLogEvents request.

Request Syntax

{

"endTime": number,

"filterPattern": "string", "interleaved": boolean, "limit": number,

"logGroupName": "string", "logStreamNamePrefix": "string", "logStreamNames": [ "string" ], "nextToken": "string",

"startTime": number }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters (p. 184).

The request accepts the following data in JSON format.

endTime (p. 74)

The end of the time range, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.

Events with a timestamp later than this time are not returned.

Type: Long

Valid Range: Minimum value of 0.

Required: No filterPattern (p. 74)

The filter pattern to use. For more information, see Filter and Pattern Syntax.

If not provided, all the events are matched.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 1024.

Required: No interleaved (p. 74)

This parameter has been deprecated.

Request Parameters

If the value is true, the operation makes a best effort to provide responses that contain events from multiple log streams within the log group, interleaved in a single response. If the value is false, all the matched log events in the first log stream are searched first, then those in the next log stream, and so on. The default is false.

Important: Starting on June 17, 2019, this parameter is ignored and the value is assumed to be true.

The response from this operation always interleaves events from multiple log streams within a log group.

Type: Boolean Required: No limit (p. 74)

The maximum number of events to return. The default is 10,000 events.

Type: Integer

Valid Range: Minimum value of 1. Maximum value of 10000.

Required: No logGroupName (p. 74)

The name of the log group to search.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 512.

Pattern: [\.\-_/#A-Za-z0-9]+

Required: Yes

logStreamNamePrefix (p. 74)

Filters the results to include only events from log streams that have names starting with this prefix.

If you specify a value for both logStreamNamePrefix and logStreamNames, but the value for logStreamNamePrefix does not match any log stream names specified in logStreamNames, the action returns an InvalidParameterException error.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 512.

Pattern: [^:*]*

Required: No logStreamNames (p. 74)

Filters the results to only logs from the log streams in this list.

If you specify a value for both logStreamNamePrefix and logStreamNames, the action returns an InvalidParameterException error.

Type: Array of strings

Array Members: Minimum number of 1 item. Maximum number of 100 items.

Length Constraints: Minimum length of 1. Maximum length of 512.

Response Syntax

Pattern: [^:*]*

Required: No nextToken (p. 74)

The token for the next set of events to return. (You received this token from a previous call.) Type: String

Length Constraints: Minimum length of 1.

Required: No startTime (p. 74)

The start of the time range, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a timestamp before this time are not returned.

Type: Long

Valid Range: Minimum value of 0.

Required: No

"nextToken": "string", "searchedLogStreams": [ {

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

events (p. 76)

The matched events.

Type: Array of FilteredLogEvent (p. 155) objects nextToken (p. 76)

The token to use when requesting the next set of items. The token expires after 24 hours.

Errors

Type: String

Length Constraints: Minimum length of 1.

searchedLogStreams (p. 76)

IMPORTANT Starting on May 15, 2020, this parameter will be deprecated. This parameter will be an empty list after the deprecation occurs.

Indicates which log streams have been searched and whether each has been searched completely.

Type: Array of SearchedLogStream (p. 179) objects

Errors

For information about the errors that are common to all actions, see Common Errors (p. 186).

InvalidParameterException

A parameter is specified incorrectly.

HTTP Status Code: 400 ResourceNotFoundException

The specified resource does not exist.

HTTP Status Code: 400 ServiceUnavailableException

The service cannot complete the request.

HTTP Status Code: 500

Examples

在文檔中 Amazon CloudWatch Logs (頁 81-86)

相關文件