

# Actions
<a name="API_Operations"></a>

The following actions are supported:
+  [AssociateKmsKey](API_AssociateKmsKey.md) 
+  [AssociateSourceToS3TableIntegration](API_AssociateSourceToS3TableIntegration.md) 
+  [CancelExportTask](API_CancelExportTask.md) 
+  [CancelImportTask](API_CancelImportTask.md) 
+  [CreateDelivery](API_CreateDelivery.md) 
+  [CreateExportTask](API_CreateExportTask.md) 
+  [CreateImportTask](API_CreateImportTask.md) 
+  [CreateLogAnomalyDetector](API_CreateLogAnomalyDetector.md) 
+  [CreateLogGroup](API_CreateLogGroup.md) 
+  [CreateLogStream](API_CreateLogStream.md) 
+  [CreateLookupTable](API_CreateLookupTable.md) 
+  [CreateScheduledQuery](API_CreateScheduledQuery.md) 
+  [DeleteAccountPolicy](API_DeleteAccountPolicy.md) 
+  [DeleteDataProtectionPolicy](API_DeleteDataProtectionPolicy.md) 
+  [DeleteDelivery](API_DeleteDelivery.md) 
+  [DeleteDeliveryDestination](API_DeleteDeliveryDestination.md) 
+  [DeleteDeliveryDestinationPolicy](API_DeleteDeliveryDestinationPolicy.md) 
+  [DeleteDeliverySource](API_DeleteDeliverySource.md) 
+  [DeleteDestination](API_DeleteDestination.md) 
+  [DeleteIndexPolicy](API_DeleteIndexPolicy.md) 
+  [DeleteIntegration](API_DeleteIntegration.md) 
+  [DeleteLogAnomalyDetector](API_DeleteLogAnomalyDetector.md) 
+  [DeleteLogGroup](API_DeleteLogGroup.md) 
+  [DeleteLogStream](API_DeleteLogStream.md) 
+  [DeleteLookupTable](API_DeleteLookupTable.md) 
+  [DeleteMetricFilter](API_DeleteMetricFilter.md) 
+  [DeleteQueryDefinition](API_DeleteQueryDefinition.md) 
+  [DeleteResourcePolicy](API_DeleteResourcePolicy.md) 
+  [DeleteRetentionPolicy](API_DeleteRetentionPolicy.md) 
+  [DeleteScheduledQuery](API_DeleteScheduledQuery.md) 
+  [DeleteSubscriptionFilter](API_DeleteSubscriptionFilter.md) 
+  [DeleteTransformer](API_DeleteTransformer.md) 
+  [DescribeAccountPolicies](API_DescribeAccountPolicies.md) 
+  [DescribeConfigurationTemplates](API_DescribeConfigurationTemplates.md) 
+  [DescribeDeliveries](API_DescribeDeliveries.md) 
+  [DescribeDeliveryDestinations](API_DescribeDeliveryDestinations.md) 
+  [DescribeDeliverySources](API_DescribeDeliverySources.md) 
+  [DescribeDestinations](API_DescribeDestinations.md) 
+  [DescribeExportTasks](API_DescribeExportTasks.md) 
+  [DescribeFieldIndexes](API_DescribeFieldIndexes.md) 
+  [DescribeImportTaskBatches](API_DescribeImportTaskBatches.md) 
+  [DescribeImportTasks](API_DescribeImportTasks.md) 
+  [DescribeIndexPolicies](API_DescribeIndexPolicies.md) 
+  [DescribeLogGroups](API_DescribeLogGroups.md) 
+  [DescribeLogStreams](API_DescribeLogStreams.md) 
+  [DescribeLookupTables](API_DescribeLookupTables.md) 
+  [DescribeMetricFilters](API_DescribeMetricFilters.md) 
+  [DescribeQueries](API_DescribeQueries.md) 
+  [DescribeQueryDefinitions](API_DescribeQueryDefinitions.md) 
+  [DescribeResourcePolicies](API_DescribeResourcePolicies.md) 
+  [DescribeSubscriptionFilters](API_DescribeSubscriptionFilters.md) 
+  [DisassociateKmsKey](API_DisassociateKmsKey.md) 
+  [DisassociateSourceFromS3TableIntegration](API_DisassociateSourceFromS3TableIntegration.md) 
+  [FilterLogEvents](API_FilterLogEvents.md) 
+  [GetDataProtectionPolicy](API_GetDataProtectionPolicy.md) 
+  [GetDelivery](API_GetDelivery.md) 
+  [GetDeliveryDestination](API_GetDeliveryDestination.md) 
+  [GetDeliveryDestinationPolicy](API_GetDeliveryDestinationPolicy.md) 
+  [GetDeliverySource](API_GetDeliverySource.md) 
+  [GetIntegration](API_GetIntegration.md) 
+  [GetLogAnomalyDetector](API_GetLogAnomalyDetector.md) 
+  [GetLogEvents](API_GetLogEvents.md) 
+  [GetLogFields](API_GetLogFields.md) 
+  [GetLogGroupFields](API_GetLogGroupFields.md) 
+  [GetLogObject](API_GetLogObject.md) 
+  [GetLogRecord](API_GetLogRecord.md) 
+  [GetLookupTable](API_GetLookupTable.md) 
+  [GetQueryResults](API_GetQueryResults.md) 
+  [GetScheduledQuery](API_GetScheduledQuery.md) 
+  [GetScheduledQueryHistory](API_GetScheduledQueryHistory.md) 
+  [GetTransformer](API_GetTransformer.md) 
+  [ListAggregateLogGroupSummaries](API_ListAggregateLogGroupSummaries.md) 
+  [ListAnomalies](API_ListAnomalies.md) 
+  [ListIntegrations](API_ListIntegrations.md) 
+  [ListLogAnomalyDetectors](API_ListLogAnomalyDetectors.md) 
+  [ListLogGroups](API_ListLogGroups.md) 
+  [ListLogGroupsForQuery](API_ListLogGroupsForQuery.md) 
+  [ListScheduledQueries](API_ListScheduledQueries.md) 
+  [ListSourcesForS3TableIntegration](API_ListSourcesForS3TableIntegration.md) 
+  [ListTagsForResource](API_ListTagsForResource.md) 
+  [ListTagsLogGroup](API_ListTagsLogGroup.md) 
+  [PutAccountPolicy](API_PutAccountPolicy.md) 
+  [PutBearerTokenAuthentication](API_PutBearerTokenAuthentication.md) 
+  [PutDataProtectionPolicy](API_PutDataProtectionPolicy.md) 
+  [PutDeliveryDestination](API_PutDeliveryDestination.md) 
+  [PutDeliveryDestinationPolicy](API_PutDeliveryDestinationPolicy.md) 
+  [PutDeliverySource](API_PutDeliverySource.md) 
+  [PutDestination](API_PutDestination.md) 
+  [PutDestinationPolicy](API_PutDestinationPolicy.md) 
+  [PutIndexPolicy](API_PutIndexPolicy.md) 
+  [PutIntegration](API_PutIntegration.md) 
+  [PutLogEvents](API_PutLogEvents.md) 
+  [PutLogGroupDeletionProtection](API_PutLogGroupDeletionProtection.md) 
+  [PutMetricFilter](API_PutMetricFilter.md) 
+  [PutQueryDefinition](API_PutQueryDefinition.md) 
+  [PutResourcePolicy](API_PutResourcePolicy.md) 
+  [PutRetentionPolicy](API_PutRetentionPolicy.md) 
+  [PutSubscriptionFilter](API_PutSubscriptionFilter.md) 
+  [PutTransformer](API_PutTransformer.md) 
+  [StartLiveTail](API_StartLiveTail.md) 
+  [StartQuery](API_StartQuery.md) 
+  [StopQuery](API_StopQuery.md) 
+  [TagLogGroup](API_TagLogGroup.md) 
+  [TagResource](API_TagResource.md) 
+  [TestMetricFilter](API_TestMetricFilter.md) 
+  [TestTransformer](API_TestTransformer.md) 
+  [UntagLogGroup](API_UntagLogGroup.md) 
+  [UntagResource](API_UntagResource.md) 
+  [UpdateAnomaly](API_UpdateAnomaly.md) 
+  [UpdateDeliveryConfiguration](API_UpdateDeliveryConfiguration.md) 
+  [UpdateLogAnomalyDetector](API_UpdateLogAnomalyDetector.md) 
+  [UpdateLookupTable](API_UpdateLookupTable.md) 
+  [UpdateScheduledQuery](API_UpdateScheduledQuery.md) 

# AssociateKmsKey
<a name="API_AssociateKmsKey"></a>

Associates the specified AWS KMS key with either one log group in the account, or with all stored CloudWatch Logs query insights results in the account.

When you use `AssociateKmsKey`, you specify either the `logGroupName` parameter or the `resourceIdentifier` parameter. You can't specify both of those parameters in the same operation.
+ Specify the `logGroupName` parameter to cause log events ingested into that log group to be encrypted with that key. Only the log events ingested after the key is associated are encrypted with that key.

  Associating a KMS key with a log group overrides any existing associations between the log group and a KMS key. After a KMS key is associated with a log group, all newly ingested data for the log group is encrypted using the KMS key. This association is stored as long as the data encrypted with the KMS key is still within CloudWatch Logs. This enables CloudWatch Logs to decrypt this data whenever it is requested.

  Associating a key with a log group does not cause the results of queries of that log group to be encrypted with that key. To have query results encrypted with a AWS KMS key, you must use an `AssociateKmsKey` operation with the `resourceIdentifier` parameter that specifies a `query-result` resource. 
+ Specify the `resourceIdentifier` parameter with a `query-result` resource, to use that key to encrypt the stored results of all future [StartQuery](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_StartQuery.html) operations in the account. The response from a [GetQueryResults](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_GetQueryResults.html) operation will still return the query results in plain text.

  Even if you have not associated a key with your query results, the query results are encrypted when stored, using the default CloudWatch Logs method.

  If you run a query from a monitoring account that queries logs in a source account, the query results key from the monitoring account, if any, is used.

**Important**  
If you delete the key that is used to encrypt log events or log group query results, then all the associated stored log events or query results that were encrypted with that key will be unencryptable and unusable.

**Note**  
CloudWatch Logs supports only symmetric KMS keys. Do not associate an asymmetric KMS key with your log group or query results. For more information, see [Using Symmetric and Asymmetric Keys](https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html).

It can take up to 5 minutes for this operation to take effect.

If you attempt to associate a KMS key with a log group but the KMS key does not exist or the KMS key is disabled, you receive an `InvalidParameterException` error. 

## Request Syntax
<a name="API_AssociateKmsKey_RequestSyntax"></a>

```
{
   "kmsKeyId": "string",
   "logGroupName": "string",
   "resourceIdentifier": "string"
}
```

## Request Parameters
<a name="API_AssociateKmsKey_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [kmsKeyId](#API_AssociateKmsKey_RequestSyntax) **   <a name="CWL-AssociateKmsKey-request-kmsKeyId"></a>
The Amazon Resource Name (ARN) of the KMS key to use when encrypting log data. This must be a symmetric KMS key. For more information, see [Amazon Resource Names](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kms) and [Using Symmetric and Asymmetric Keys](https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html).  
Type: String  
Length Constraints: Maximum length of 256.  
Required: Yes

 ** [logGroupName](#API_AssociateKmsKey_RequestSyntax) **   <a name="CWL-AssociateKmsKey-request-logGroupName"></a>
The name of the log group.  
In your `AssociateKmsKey` operation, you must specify either the `resourceIdentifier` parameter or the `logGroup` parameter, but you can't specify both.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[\.\-_/#A-Za-z0-9]+`   
Required: No

 ** [resourceIdentifier](#API_AssociateKmsKey_RequestSyntax) **   <a name="CWL-AssociateKmsKey-request-resourceIdentifier"></a>
Specifies the target for this operation. You must specify one of the following:  
+ Specify the following ARN to have future [GetQueryResults](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_GetQueryResults.html) operations in this account encrypt the results with the specified AWS KMS key. Replace *REGION* and *ACCOUNT\$1ID* with your Region and account ID.

   `arn:aws:logs:REGION:ACCOUNT_ID:query-result:*` 
+ Specify the ARN of a log group to have CloudWatch Logs use the AWS KMS key to encrypt log events that are ingested and stored by that log group. The log group ARN must be in the following format. Replace *REGION* and *ACCOUNT\$1ID* with your Region and account ID.

   `arn:aws:logs:REGION:ACCOUNT_ID:log-group:LOG_GROUP_NAME ` 
In your `AssociateKmsKey` operation, you must specify either the `resourceIdentifier` parameter or the `logGroup` parameter, but you can't specify both.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Pattern: `[\w+=/:,.@\-\*]*`   
Required: No

## Response Elements
<a name="API_AssociateKmsKey_ResponseElements"></a>

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

## Errors
<a name="API_AssociateKmsKey_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
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
<a name="API_AssociateKmsKey_Examples"></a>

### To associate a log group with aKMS key
<a name="API_AssociateKmsKey_Example_1"></a>

The following example associates the specified log group with the specified KMS key.

#### Sample Request
<a name="API_AssociateKmsKey_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.AssociateKmsKey
{
  "logGroupName": "my-log-group",
  "kmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/abcd1234-a123-456a-a12b-a123b456c789"
}
```

#### Sample Response
<a name="API_AssociateKmsKey_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
```

### To associate all future query results in this account with aKMS key
<a name="API_AssociateKmsKey_Example_2"></a>

The following example associates all future CloudWatch Logs Insights query results with the specified KMS key.

#### Sample Request
<a name="API_AssociateKmsKey_Example_2_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.AssociateKmsKey
{
  "resourceIdentifier": "arn:aws:logs:us-east-1:123456789012:query-result:*",
  "kmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/abcd1234-a123-456a-a12b-a123b456c789"
}
```

#### Sample Response
<a name="API_AssociateKmsKey_Example_2_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
```

## See Also
<a name="API_AssociateKmsKey_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/AssociateKmsKey) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/AssociateKmsKey) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/AssociateKmsKey) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/AssociateKmsKey) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/AssociateKmsKey) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/AssociateKmsKey) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/AssociateKmsKey) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/AssociateKmsKey) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/AssociateKmsKey) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/AssociateKmsKey) 

# AssociateSourceToS3TableIntegration
<a name="API_AssociateSourceToS3TableIntegration"></a>

Associates a data source with an S3 Table Integration for query access in the 'logs' namespace. This enables querying log data using analytics engines that support Iceberg such as Amazon Athena, Amazon Redshift, and Apache Spark.

## Request Syntax
<a name="API_AssociateSourceToS3TableIntegration_RequestSyntax"></a>

```
{
   "dataSource": { 
      "name": "string",
      "type": "string"
   },
   "integrationArn": "string"
}
```

## Request Parameters
<a name="API_AssociateSourceToS3TableIntegration_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [dataSource](#API_AssociateSourceToS3TableIntegration_RequestSyntax) **   <a name="CWL-AssociateSourceToS3TableIntegration-request-dataSource"></a>
The data source to associate with the S3 Table Integration. Contains the name and type of the data source.  
Type: [DataSource](API_DataSource.md) object  
Required: Yes

 ** [integrationArn](#API_AssociateSourceToS3TableIntegration_RequestSyntax) **   <a name="CWL-AssociateSourceToS3TableIntegration-request-integrationArn"></a>
The Amazon Resource Name (ARN) of the S3 Table Integration to associate the data source with.  
Type: String  
Required: Yes

## Response Syntax
<a name="API_AssociateSourceToS3TableIntegration_ResponseSyntax"></a>

```
{
   "identifier": "string"
}
```

## Response Elements
<a name="API_AssociateSourceToS3TableIntegration_ResponseElements"></a>

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

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

 ** [identifier](#API_AssociateSourceToS3TableIntegration_ResponseSyntax) **   <a name="CWL-AssociateSourceToS3TableIntegration-response-identifier"></a>
The unique identifier for the association between the data source and S3 Table Integration.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.

## Errors
<a name="API_AssociateSourceToS3TableIntegration_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have sufficient permissions to perform this action.  
HTTP Status Code: 400

 ** InternalServerException **   
An internal server error occurred while processing the request. This exception is returned when the service encounters an unexpected condition that prevents it from fulfilling the request.  
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The specified resource does not exist.  
HTTP Status Code: 400

 ** ThrottlingException **   
The request was throttled because of quota limits.  
HTTP Status Code: 400

 ** ValidationException **   
One of the parameters for the request is not valid.  
HTTP Status Code: 400

## See Also
<a name="API_AssociateSourceToS3TableIntegration_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/AssociateSourceToS3TableIntegration) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/AssociateSourceToS3TableIntegration) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/AssociateSourceToS3TableIntegration) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/AssociateSourceToS3TableIntegration) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/AssociateSourceToS3TableIntegration) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/AssociateSourceToS3TableIntegration) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/AssociateSourceToS3TableIntegration) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/AssociateSourceToS3TableIntegration) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/AssociateSourceToS3TableIntegration) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/AssociateSourceToS3TableIntegration) 

# CancelExportTask
<a name="API_CancelExportTask"></a>

Cancels the specified export task.

The task must be in the `PENDING` or `RUNNING` state.

## Request Syntax
<a name="API_CancelExportTask_RequestSyntax"></a>

```
{
   "taskId": "string"
}
```

## Request Parameters
<a name="API_CancelExportTask_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [taskId](#API_CancelExportTask_RequestSyntax) **   <a name="CWL-CancelExportTask-request-taskId"></a>
The ID of the export task.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Required: Yes

## Response Elements
<a name="API_CancelExportTask_ResponseElements"></a>

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

## Errors
<a name="API_CancelExportTask_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidOperationException **   
The operation is not valid on the specified resource.  
HTTP Status Code: 400

 ** 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
<a name="API_CancelExportTask_Examples"></a>

### To cancel an export task
<a name="API_CancelExportTask_Example_1"></a>

The following example cancels the specified task.

#### Sample Request
<a name="API_CancelExportTask_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.CancelExportTask
{
  "taskId": "exampleTaskId"
}
```

#### Sample Response
<a name="API_CancelExportTask_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
```

## See Also
<a name="API_CancelExportTask_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/CancelExportTask) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/CancelExportTask) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/CancelExportTask) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/CancelExportTask) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/CancelExportTask) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/CancelExportTask) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/CancelExportTask) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/CancelExportTask) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/CancelExportTask) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/CancelExportTask) 

# CancelImportTask
<a name="API_CancelImportTask"></a>

Cancels an active import task and stops importing data from the CloudTrail Lake Event Data Store.

## Request Syntax
<a name="API_CancelImportTask_RequestSyntax"></a>

```
{
   "importId": "string"
}
```

## Request Parameters
<a name="API_CancelImportTask_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [importId](#API_CancelImportTask_RequestSyntax) **   <a name="CWL-CancelImportTask-request-importId"></a>
The ID of the import task to cancel.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 256.  
Pattern: `[\-a-zA-Z0-9]+`   
Required: Yes

## Response Syntax
<a name="API_CancelImportTask_ResponseSyntax"></a>

```
{
   "creationTime": number,
   "importId": "string",
   "importStatistics": { 
      "bytesImported": number
   },
   "importStatus": "string",
   "lastUpdatedTime": number
}
```

## Response Elements
<a name="API_CancelImportTask_ResponseElements"></a>

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

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

 ** [creationTime](#API_CancelImportTask_ResponseSyntax) **   <a name="CWL-CancelImportTask-response-creationTime"></a>
The timestamp when the import task was created, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.  
Type: Long  
Valid Range: Minimum value of 0.

 ** [importId](#API_CancelImportTask_ResponseSyntax) **   <a name="CWL-CancelImportTask-response-importId"></a>
The ID of the cancelled import task.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 256.  
Pattern: `[\-a-zA-Z0-9]+` 

 ** [importStatistics](#API_CancelImportTask_ResponseSyntax) **   <a name="CWL-CancelImportTask-response-importStatistics"></a>
Statistics about the import progress at the time of cancellation.  
Type: [ImportStatistics](API_ImportStatistics.md) object

 ** [importStatus](#API_CancelImportTask_ResponseSyntax) **   <a name="CWL-CancelImportTask-response-importStatus"></a>
The final status of the import task. This will be set to CANCELLED.  
Type: String  
Valid Values: `IN_PROGRESS | CANCELLED | COMPLETED | FAILED` 

 ** [lastUpdatedTime](#API_CancelImportTask_ResponseSyntax) **   <a name="CWL-CancelImportTask-response-lastUpdatedTime"></a>
The timestamp when the import task was cancelled, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.  
Type: Long  
Valid Range: Minimum value of 0.

## Errors
<a name="API_CancelImportTask_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have sufficient permissions to perform this action.  
HTTP Status Code: 400

 ** InvalidOperationException **   
The operation is not valid on the specified resource.  
HTTP Status Code: 400

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
The specified resource does not exist.  
HTTP Status Code: 400

 ** ThrottlingException **   
The request was throttled because of quota limits.  
HTTP Status Code: 400

## Examples
<a name="API_CancelImportTask_Examples"></a>

### To cancel an import task
<a name="API_CancelImportTask_Example_1"></a>

The following example cancels an active import task and returns the final status.

#### Sample Request
<a name="API_CancelImportTask_Example_1_Request"></a>

```
POST / HTTP/1.1
          Host: logs.<region>.<domain>
          X-Amz-Target: Logs_20140328.CancelImportTask
          {
          "importId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
          }
```

#### Sample Response
<a name="API_CancelImportTask_Example_1_Response"></a>

```
HTTP/1.1 200 OK
          {
          "importId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
          "importStatistics": {
          "bytesImported": 524288
          },
          "importStatus": "CANCELLED",
          "creationTime": 1641168000000,
          "lastUpdatedTime": 1641175200000
          }
```

## See Also
<a name="API_CancelImportTask_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/CancelImportTask) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/CancelImportTask) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/CancelImportTask) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/CancelImportTask) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/CancelImportTask) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/CancelImportTask) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/CancelImportTask) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/CancelImportTask) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/CancelImportTask) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/CancelImportTask) 

# CreateDelivery
<a name="API_CreateDelivery"></a>

Creates a *delivery*. A delivery is a connection between a logical *delivery source* and a logical *delivery destination* that you have already created.

Only some AWS services support being configured as a delivery source using this operation. These services are listed as **Supported [V2 Permissions]** in the table at [Enabling logging from AWS services.](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html) 

A delivery destination can represent a log group in CloudWatch Logs, an Amazon S3 bucket, a delivery stream in Firehose, or X-Ray.

To configure logs delivery between a supported AWS service and a destination, you must do the following:
+ Create a delivery source, which is a logical object that represents the resource that is actually sending the logs. For more information, see [PutDeliverySource](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliverySource.html).
+ Create a *delivery destination*, which is a logical object that represents the actual delivery destination. For more information, see [PutDeliveryDestination](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliveryDestination.html).
+ If you are delivering logs cross-account, you must use [PutDeliveryDestinationPolicy](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliveryDestinationPolicy.html) in the destination account to assign an IAM policy to the destination. This policy allows delivery to that destination. 
+ Use `CreateDelivery` to create a *delivery* by pairing exactly one delivery source and one delivery destination. 

You can configure a single delivery source to send logs to multiple destinations by creating multiple deliveries. You can also create multiple deliveries to configure multiple delivery sources to send logs to the same delivery destination.

To update an existing delivery configuration, use [UpdateDeliveryConfiguration](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_UpdateDeliveryConfiguration.html).

## Request Syntax
<a name="API_CreateDelivery_RequestSyntax"></a>

```
{
   "deliveryDestinationArn": "string",
   "deliverySourceName": "string",
   "fieldDelimiter": "string",
   "recordFields": [ "string" ],
   "s3DeliveryConfiguration": { 
      "enableHiveCompatiblePath": boolean,
      "suffixPath": "string"
   },
   "tags": { 
      "string" : "string" 
   }
}
```

## Request Parameters
<a name="API_CreateDelivery_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [deliveryDestinationArn](#API_CreateDelivery_RequestSyntax) **   <a name="CWL-CreateDelivery-request-deliveryDestinationArn"></a>
The ARN of the delivery destination to use for this delivery.  
Type: String  
Required: Yes

 ** [deliverySourceName](#API_CreateDelivery_RequestSyntax) **   <a name="CWL-CreateDelivery-request-deliverySourceName"></a>
The name of the delivery source to use for this delivery.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 60.  
Pattern: `[\w-]*`   
Required: Yes

 ** [fieldDelimiter](#API_CreateDelivery_RequestSyntax) **   <a name="CWL-CreateDelivery-request-fieldDelimiter"></a>
The field delimiter to use between record fields when the final output format of a delivery is in `Plain`, `W3C`, or `Raw` format.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 5.  
Required: No

 ** [recordFields](#API_CreateDelivery_RequestSyntax) **   <a name="CWL-CreateDelivery-request-recordFields"></a>
The list of record fields to be delivered to the destination, in order. If the delivery's log source has mandatory fields, they must be included in this list.  
Type: Array of strings  
Array Members: Minimum number of 0 items. Maximum number of 128 items.  
Length Constraints: Minimum length of 1. Maximum length of 64.  
Required: No

 ** [s3DeliveryConfiguration](#API_CreateDelivery_RequestSyntax) **   <a name="CWL-CreateDelivery-request-s3DeliveryConfiguration"></a>
This structure contains parameters that are valid only when the delivery's delivery destination is an S3 bucket.  
Type: [S3DeliveryConfiguration](API_S3DeliveryConfiguration.md) object  
Required: No

 ** [tags](#API_CreateDelivery_RequestSyntax) **   <a name="CWL-CreateDelivery-request-tags"></a>
An optional list of key-value pairs to associate with the resource.  
For more information about tagging, see [Tagging AWS resources](https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html)   
Type: String to string map  
Map Entries: Maximum number of 50 items.  
Key Length Constraints: Minimum length of 1. Maximum length of 128.  
Key Pattern: `^([\p{L}\p{Z}\p{N}_.:/=+\-@]+)$`   
Value Length Constraints: Maximum length of 256.  
Value Pattern: `^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$`   
Required: No

## Response Syntax
<a name="API_CreateDelivery_ResponseSyntax"></a>

```
{
   "delivery": { 
      "arn": "string",
      "deliveryDestinationArn": "string",
      "deliveryDestinationType": "string",
      "deliverySourceName": "string",
      "fieldDelimiter": "string",
      "id": "string",
      "recordFields": [ "string" ],
      "s3DeliveryConfiguration": { 
         "enableHiveCompatiblePath": boolean,
         "suffixPath": "string"
      },
      "tags": { 
         "string" : "string" 
      }
   }
}
```

## Response Elements
<a name="API_CreateDelivery_ResponseElements"></a>

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

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

 ** [delivery](#API_CreateDelivery_ResponseSyntax) **   <a name="CWL-CreateDelivery-response-delivery"></a>
A structure that contains information about the delivery that you just created.  
Type: [Delivery](API_Delivery.md) object

## Errors
<a name="API_CreateDelivery_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have sufficient permissions to perform this action.  
HTTP Status Code: 400

 ** ConflictException **   
This operation attempted to create a resource that already exists.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
The specified resource does not exist.  
HTTP Status Code: 400

 ** ServiceQuotaExceededException **   
This request exceeds a service quota.  
HTTP Status Code: 400

 ** ServiceUnavailableException **   
The service cannot complete the request.  
HTTP Status Code: 500

 ** ThrottlingException **   
The request was throttled because of quota limits.  
HTTP Status Code: 400

 ** ValidationException **   
One of the parameters for the request is not valid.  
HTTP Status Code: 400

## See Also
<a name="API_CreateDelivery_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/CreateDelivery) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/CreateDelivery) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/CreateDelivery) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/CreateDelivery) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/CreateDelivery) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/CreateDelivery) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/CreateDelivery) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/CreateDelivery) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/CreateDelivery) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/CreateDelivery) 

# CreateExportTask
<a name="API_CreateExportTask"></a>

Creates an export task so that you can efficiently export data from a log group to an Amazon S3 bucket. When you perform a `CreateExportTask` operation, you must use credentials that have permission to write to the S3 bucket that you specify as the destination.

Exporting log data to S3 buckets that are encrypted by AWS KMS is supported. Exporting log data to Amazon S3 buckets that have S3 Object Lock enabled with a retention period is also supported.

Exporting to S3 buckets that are encrypted with AES-256 is supported. 

This is an asynchronous call. If all the required information is provided, this operation initiates an export task and responds with the ID of the task. After the task has started, you can use [DescribeExportTasks](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeExportTasks.html) to get the status of the export task. Each account can only have one active (`RUNNING` or `PENDING`) export task at a time. To cancel an export task, use [CancelExportTask](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CancelExportTask.html).

You can export logs from multiple log groups or multiple time ranges to the same S3 bucket. To separate log data for each export task, specify a prefix to be used as the Amazon S3 key prefix for all exported objects.

**Note**  
We recommend that you don't regularly export to Amazon S3 as a way to continuously archive your logs. For that use case, we instead recommend that you use subscriptions. For more information about subscriptions, see [Real-time processing of log data with subscriptions](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Subscriptions.html).

**Note**  
Time-based sorting on chunks of log data inside an exported file is not guaranteed. You can sort the exported log field data by using Linux utilities.

## Request Syntax
<a name="API_CreateExportTask_RequestSyntax"></a>

```
{
   "destination": "string",
   "destinationPrefix": "string",
   "from": number,
   "logGroupName": "string",
   "logStreamNamePrefix": "string",
   "taskName": "string",
   "to": number
}
```

## Request Parameters
<a name="API_CreateExportTask_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [destination](#API_CreateExportTask_RequestSyntax) **   <a name="CWL-CreateExportTask-request-destination"></a>
The name of S3 bucket for the exported log data. The bucket must be in the same AWS Region.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Required: Yes

 ** [destinationPrefix](#API_CreateExportTask_RequestSyntax) **   <a name="CWL-CreateExportTask-request-destinationPrefix"></a>
The prefix used as the start of the key for every object exported. If you don't specify a value, the default is `exportedlogs`.  
The length of this parameter must comply with the S3 object key name length limits. The object key name is a sequence of Unicode characters with UTF-8 encoding, and can be up to 1,024 bytes.  
Type: String  
Required: No

 ** [from](#API_CreateExportTask_RequestSyntax) **   <a name="CWL-CreateExportTask-request-from"></a>
The start time of the range for the request, expressed as the number of milliseconds after `Jan 1, 1970 00:00:00 UTC`. Events with a timestamp earlier than this time are not exported.  
Type: Long  
Valid Range: Minimum value of 0.  
Required: Yes

 ** [logGroupName](#API_CreateExportTask_RequestSyntax) **   <a name="CWL-CreateExportTask-request-logGroupName"></a>
The name of the log group.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[\.\-_/#A-Za-z0-9]+`   
Required: Yes

 ** [logStreamNamePrefix](#API_CreateExportTask_RequestSyntax) **   <a name="CWL-CreateExportTask-request-logStreamNamePrefix"></a>
Export only log streams that match the provided prefix. If you don't specify a value, no prefix filter is applied.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[^:*]*`   
Required: No

 ** [taskName](#API_CreateExportTask_RequestSyntax) **   <a name="CWL-CreateExportTask-request-taskName"></a>
The name of the export task.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Required: No

 ** [to](#API_CreateExportTask_RequestSyntax) **   <a name="CWL-CreateExportTask-request-to"></a>
The end time of the range for the request, expressed as the number of milliseconds after `Jan 1, 1970 00:00:00 UTC`. Events with a timestamp later than this time are not exported.  
You must specify a time that is not earlier than when this log group was created.  
Type: Long  
Valid Range: Minimum value of 0.  
Required: Yes

## Response Syntax
<a name="API_CreateExportTask_ResponseSyntax"></a>

```
{
   "taskId": "string"
}
```

## Response Elements
<a name="API_CreateExportTask_ResponseElements"></a>

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

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

 ** [taskId](#API_CreateExportTask_ResponseSyntax) **   <a name="CWL-CreateExportTask-response-taskId"></a>
The ID of the export task.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.

## Errors
<a name="API_CreateExportTask_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** LimitExceededException **   
You have reached the maximum number of resources that can be created.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
HTTP Status Code: 400

 ** ResourceAlreadyExistsException **   
The specified resource already exists.  
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
<a name="API_CreateExportTask_Examples"></a>

### To create an export task
<a name="API_CreateExportTask_Example_1"></a>

The following example creates an export task that exports data from a log group to an S3 bucket.

#### Sample Request
<a name="API_CreateExportTask_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.CreateExportTask
{
  "taskName": "my-task",
  "logGroupName": "my-log-group",
  "from": 1437584472382,
  "to": 1437584472833,
  "destination": "my-destination",
  "destinationPrefix": "my-prefix"
}
```

#### Sample Response
<a name="API_CreateExportTask_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
  "taskId": "exampleTaskId"
}
```

## See Also
<a name="API_CreateExportTask_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/CreateExportTask) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/CreateExportTask) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/CreateExportTask) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/CreateExportTask) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/CreateExportTask) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/CreateExportTask) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/CreateExportTask) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/CreateExportTask) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/CreateExportTask) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/CreateExportTask) 

# CreateImportTask
<a name="API_CreateImportTask"></a>

Starts an import from a data source to CloudWatch Log and creates a managed log group as the destination for the imported data. Currently, [CloudTrail Event Data Store](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store.html) is the only supported data source. 

The import task must satisfy the following constraints:
+ The specified source must be in an ACTIVE state.
+ The API caller must have permissions to access the data in the provided source and to perform iam:PassRole on the provided import role which has the same permissions, as described below.
+ The provided IAM role must trust the "cloudtrail.amazonaws.com" principal and have the following permissions:
  + cloudtrail:GetEventDataStoreData
  + logs:CreateLogGroup
  + logs:CreateLogStream
  + logs:PutResourcePolicy
  + (If source has an associated AWS KMS Key) kms:Decrypt
  + (If source has an associated AWS KMS Key) kms:GenerateDataKey

  Example IAM policy for provided import role:

   `[ { "Effect": "Allow", "Action": "iam:PassRole", "Resource": "arn:aws:iam::123456789012:role/apiCallerCredentials", "Condition": { "StringLike": { "iam:AssociatedResourceARN": "arn:aws:logs:us-east-1:123456789012:log-group:aws/cloudtrail/f1d45bff-d0e3-4868-b5d9-2eb678aa32fb:*" } } }, { "Effect": "Allow", "Action": [ "cloudtrail:GetEventDataStoreData" ], "Resource": [ "arn:aws:cloudtrail:us-east-1:123456789012:eventdatastore/f1d45bff-d0e3-4868-b5d9-2eb678aa32fb" ] }, { "Effect": "Allow", "Action": [ "logs:CreateImportTask", "logs:CreateLogGroup", "logs:CreateLogStream", "logs:PutResourcePolicy" ], "Resource": [ "arn:aws:logs:us-east-1:123456789012:log-group:/aws/cloudtrail/*" ] }, { "Effect": "Allow", "Action": [ "kms:Decrypt", "kms:GenerateDataKey" ], "Resource": [ "arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012" ] } ]` 
+ If the import source has a customer managed key, the "cloudtrail.amazonaws.com" principal needs permissions to perform kms:Decrypt and kms:GenerateDataKey.
+ There can be no more than 3 active imports per account at a given time.
+ The startEventTime must be less than or equal to endEventTime.
+ The data being imported must be within the specified source's retention period.

## Request Syntax
<a name="API_CreateImportTask_RequestSyntax"></a>

```
{
   "importFilter": { 
      "endEventTime": number,
      "startEventTime": number
   },
   "importRoleArn": "string",
   "importSourceArn": "string"
}
```

## Request Parameters
<a name="API_CreateImportTask_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [importFilter](#API_CreateImportTask_RequestSyntax) **   <a name="CWL-CreateImportTask-request-importFilter"></a>
Optional filters to constrain the import by CloudTrail event time. Times are specified in Unix timestamp milliseconds. The range of data being imported must be within the specified source's retention period.  
Type: [ImportFilter](API_ImportFilter.md) object  
Required: No

 ** [importRoleArn](#API_CreateImportTask_RequestSyntax) **   <a name="CWL-CreateImportTask-request-importRoleArn"></a>
The ARN of the IAM role that grants CloudWatch Logs permission to import from the CloudTrail Lake Event Data Store.  
Type: String  
Length Constraints: Minimum length of 1.  
Required: Yes

 ** [importSourceArn](#API_CreateImportTask_RequestSyntax) **   <a name="CWL-CreateImportTask-request-importSourceArn"></a>
The ARN of the source to import from.  
Type: String  
Required: Yes

## Response Syntax
<a name="API_CreateImportTask_ResponseSyntax"></a>

```
{
   "creationTime": number,
   "importDestinationArn": "string",
   "importId": "string"
}
```

## Response Elements
<a name="API_CreateImportTask_ResponseElements"></a>

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

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

 ** [creationTime](#API_CreateImportTask_ResponseSyntax) **   <a name="CWL-CreateImportTask-response-creationTime"></a>
The timestamp when the import task was created, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.  
Type: Long  
Valid Range: Minimum value of 0.

 ** [importDestinationArn](#API_CreateImportTask_ResponseSyntax) **   <a name="CWL-CreateImportTask-response-importDestinationArn"></a>
The ARN of the CloudWatch Logs log group created as the destination for the imported events.  
Type: String

 ** [importId](#API_CreateImportTask_ResponseSyntax) **   <a name="CWL-CreateImportTask-response-importId"></a>
A unique identifier for the import task.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 256.  
Pattern: `[\-a-zA-Z0-9]+` 

## Errors
<a name="API_CreateImportTask_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have sufficient permissions to perform this action.  
HTTP Status Code: 400

 ** ConflictException **   
This operation attempted to create a resource that already exists.  
HTTP Status Code: 400

 ** InvalidOperationException **   
The operation is not valid on the specified resource.  
HTTP Status Code: 400

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
The specified resource does not exist.  
HTTP Status Code: 400

 ** ThrottlingException **   
The request was throttled because of quota limits.  
HTTP Status Code: 400

 ** ValidationException **   
One of the parameters for the request is not valid.  
HTTP Status Code: 400

## Examples
<a name="API_CreateImportTask_Examples"></a>

### To create an import task from CloudTrail Lake to CloudWatch Logs
<a name="API_CreateImportTask_Example_1"></a>

The following example creates an import task with time-based filters.

#### Sample Request
<a name="API_CreateImportTask_Example_1_Request"></a>

```
POST / HTTP/1.1
          Host: logs.<region>.<domain>
          X-Amz-Target: Logs_20140328.CreateImportTask
          {
          "importSourceArn": "arn:aws:cloudtrail:us-east-1:123456789012:eventdatastore/f1d45bff-d0e3-4868-b5d9-2eb678aa32fb",
          "importRoleArn": "arn:aws:iam::123456789012:role/CloudWatchLogsImportRole",
          "importFilter": {
          "startEventTime": 1640995200000,
          "endEventTime": 1641081600000
          }
          }
```

#### Sample Response
<a name="API_CreateImportTask_Example_1_Response"></a>

```
HTTP/1.1 200 OK
          {
          "importId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
          "importDestinationArn": "arn:aws:logs:us-east-1:123456789012:log-group:aws/cloudtrail/f1d45bff-d0e3-4868-b5d9-2eb678aa32fb",
          "creationTime": 1641168000000
          }
```

## See Also
<a name="API_CreateImportTask_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/CreateImportTask) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/CreateImportTask) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/CreateImportTask) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/CreateImportTask) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/CreateImportTask) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/CreateImportTask) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/CreateImportTask) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/CreateImportTask) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/CreateImportTask) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/CreateImportTask) 

# CreateLogAnomalyDetector
<a name="API_CreateLogAnomalyDetector"></a>

Creates an *anomaly detector* that regularly scans one or more log groups and look for patterns and anomalies in the logs.

An anomaly detector can help surface issues by automatically discovering anomalies in your log event traffic. An anomaly detector uses machine learning algorithms to scan log events and find *patterns*. A pattern is a shared text structure that recurs among your log fields. Patterns provide a useful tool for analyzing large sets of logs because a large number of log events can often be compressed into a few patterns.

The anomaly detector uses pattern recognition to find `anomalies`, which are unusual log events. It uses the `evaluationFrequency` to compare current log events and patterns with trained baselines. 

Fields within a pattern are called *tokens*. Fields that vary within a pattern, such as a request ID or timestamp, are referred to as *dynamic tokens* and represented by `<*>`. 

The following is an example of a pattern:

 `[INFO] Request time: <*> ms` 

This pattern represents log events like `[INFO] Request time: 327 ms` and other similar log events that differ only by the number, in this csse 327. When the pattern is displayed, the different numbers are replaced by `<*>` 

**Note**  
Any parts of log events that are masked as sensitive data are not scanned for anomalies. For more information about masking sensitive data, see [Help protect sensitive log data with masking](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/mask-sensitive-log-data.html). 

## Request Syntax
<a name="API_CreateLogAnomalyDetector_RequestSyntax"></a>

```
{
   "anomalyVisibilityTime": number,
   "detectorName": "string",
   "evaluationFrequency": "string",
   "filterPattern": "string",
   "kmsKeyId": "string",
   "logGroupArnList": [ "string" ],
   "tags": { 
      "string" : "string" 
   }
}
```

## Request Parameters
<a name="API_CreateLogAnomalyDetector_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [anomalyVisibilityTime](#API_CreateLogAnomalyDetector_RequestSyntax) **   <a name="CWL-CreateLogAnomalyDetector-request-anomalyVisibilityTime"></a>
The number of days to have visibility on an anomaly. After this time period has elapsed for an anomaly, it will be automatically baselined and the anomaly detector will treat new occurrences of a similar anomaly as normal. Therefore, if you do not correct the cause of an anomaly during the time period specified in `anomalyVisibilityTime`, it will be considered normal going forward and will not be detected as an anomaly.  
Type: Long  
Valid Range: Minimum value of 7. Maximum value of 90.  
Required: No

 ** [detectorName](#API_CreateLogAnomalyDetector_RequestSyntax) **   <a name="CWL-CreateLogAnomalyDetector-request-detectorName"></a>
A name for this anomaly detector.  
Type: String  
Length Constraints: Minimum length of 1.  
Required: No

 ** [evaluationFrequency](#API_CreateLogAnomalyDetector_RequestSyntax) **   <a name="CWL-CreateLogAnomalyDetector-request-evaluationFrequency"></a>
Specifies how often the anomaly detector is to run and look for anomalies. Set this value according to the frequency that the log group receives new logs. For example, if the log group receives new log events every 10 minutes, then 15 minutes might be a good setting for `evaluationFrequency` .  
Type: String  
Valid Values: `ONE_MIN | FIVE_MIN | TEN_MIN | FIFTEEN_MIN | THIRTY_MIN | ONE_HOUR`   
Required: No

 ** [filterPattern](#API_CreateLogAnomalyDetector_RequestSyntax) **   <a name="CWL-CreateLogAnomalyDetector-request-filterPattern"></a>
You can use this parameter to limit the anomaly detection model to examine only log events that match the pattern you specify here. For more information, see [Filter and Pattern Syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html).  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Required: No

 ** [kmsKeyId](#API_CreateLogAnomalyDetector_RequestSyntax) **   <a name="CWL-CreateLogAnomalyDetector-request-kmsKeyId"></a>
Optionally assigns a AWS KMS key to secure this anomaly detector and its findings. If a key is assigned, the anomalies found and the model used by this detector are encrypted at rest with the key. If a key is assigned to an anomaly detector, a user must have permissions for both this key and for the anomaly detector to retrieve information about the anomalies that it finds.  
 Make sure the value provided is a valid AWS KMS key ARN. For more information about using a AWS KMS key and to see the required IAM policy, see [Use a AWS KMS key with an anomaly detector](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/LogsAnomalyDetection-KMS.html).  
Type: String  
Length Constraints: Maximum length of 256.  
Pattern: `^arn:aws[a-z\-]*:kms:[-a-z0-9]*:[0-9]*:key/[-a-z0-9]*$`   
Required: No

 ** [logGroupArnList](#API_CreateLogAnomalyDetector_RequestSyntax) **   <a name="CWL-CreateLogAnomalyDetector-request-logGroupArnList"></a>
An array containing the ARN of the log group that this anomaly detector will watch. You can specify only one log group ARN.  
Type: Array of strings  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Pattern: `[\w#+=/:,.@-]*`   
Required: Yes

 ** [tags](#API_CreateLogAnomalyDetector_RequestSyntax) **   <a name="CWL-CreateLogAnomalyDetector-request-tags"></a>
An optional list of key-value pairs to associate with the resource.  
For more information about tagging, see [Tagging AWS resources](https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html)   
Type: String to string map  
Map Entries: Maximum number of 50 items.  
Key Length Constraints: Minimum length of 1. Maximum length of 128.  
Key Pattern: `^([\p{L}\p{Z}\p{N}_.:/=+\-@]+)$`   
Value Length Constraints: Maximum length of 256.  
Value Pattern: `^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$`   
Required: No

## Response Syntax
<a name="API_CreateLogAnomalyDetector_ResponseSyntax"></a>

```
{
   "anomalyDetectorArn": "string"
}
```

## Response Elements
<a name="API_CreateLogAnomalyDetector_ResponseElements"></a>

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

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

 ** [anomalyDetectorArn](#API_CreateLogAnomalyDetector_ResponseSyntax) **   <a name="CWL-CreateLogAnomalyDetector-response-anomalyDetectorArn"></a>
The ARN of the log anomaly detector that you just created.  
Type: String  
Length Constraints: Minimum length of 1.  
Pattern: `[\w#+=/:,.@-]*` 

## Errors
<a name="API_CreateLogAnomalyDetector_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** LimitExceededException **   
You have reached the maximum number of resources that can be created.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
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

## See Also
<a name="API_CreateLogAnomalyDetector_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/CreateLogAnomalyDetector) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/CreateLogAnomalyDetector) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/CreateLogAnomalyDetector) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/CreateLogAnomalyDetector) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/CreateLogAnomalyDetector) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/CreateLogAnomalyDetector) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/CreateLogAnomalyDetector) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/CreateLogAnomalyDetector) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/CreateLogAnomalyDetector) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/CreateLogAnomalyDetector) 

# CreateLogGroup
<a name="API_CreateLogGroup"></a>

Creates a log group with the specified name. You can create up to 1,000,000 log groups per Region per account.

You must use the following guidelines when naming a log group:
+ Log group names must be unique within a Region for an AWS account.
+ Log group names can be between 1 and 512 characters long.
+ Log group names consist of the following characters: a-z, A-Z, 0-9, '\$1' (underscore), '-' (hyphen), '/' (forward slash), '.' (period), and '\$1' (number sign)
+ Log group names can't start with the string `aws/` 

When you create a log group, by default the log events in the log group do not expire. To set a retention policy so that events expire and are deleted after a specified time, use [PutRetentionPolicy](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutRetentionPolicy.html).

If you associate an AWS KMS key with the log group, ingested data is encrypted using the KMS key. This association is stored as long as the data encrypted with the KMS key is still within CloudWatch Logs. This enables CloudWatch Logs to decrypt this data whenever it is requested.

If you attempt to associate a KMS key with the log group but the KMS key does not exist or the KMS key is disabled, you receive an `InvalidParameterException` error. 

**Important**  
CloudWatch Logs supports only symmetric KMS keys. Do not associate an asymmetric KMS key with your log group. For more information, see [Using Symmetric and Asymmetric Keys](https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html).

## Request Syntax
<a name="API_CreateLogGroup_RequestSyntax"></a>

```
{
   "deletionProtectionEnabled": boolean,
   "kmsKeyId": "string",
   "logGroupClass": "string",
   "logGroupName": "string",
   "tags": { 
      "string" : "string" 
   }
}
```

## Request Parameters
<a name="API_CreateLogGroup_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [deletionProtectionEnabled](#API_CreateLogGroup_RequestSyntax) **   <a name="CWL-CreateLogGroup-request-deletionProtectionEnabled"></a>
Use this parameter to enable deletion protection for the new log group. When enabled on a log group, deletion protection blocks all deletion operations until it is explicitly disabled. By default log groups are created without deletion protection enabled.  
Type: Boolean  
Required: No

 ** [kmsKeyId](#API_CreateLogGroup_RequestSyntax) **   <a name="CWL-CreateLogGroup-request-kmsKeyId"></a>
The Amazon Resource Name (ARN) of the KMS key to use when encrypting log data. For more information, see [Amazon Resource Names](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kms).  
Type: String  
Length Constraints: Maximum length of 256.  
Required: No

 ** [logGroupClass](#API_CreateLogGroup_RequestSyntax) **   <a name="CWL-CreateLogGroup-request-logGroupClass"></a>
Use this parameter to specify the log group class for this log group. There are three classes:  
+ The `Standard` log class supports all CloudWatch Logs features.
+ The `Infrequent Access` log class supports a subset of CloudWatch Logs features and incurs lower costs.
+ Use the `Delivery` log class only for delivering AWS Lambda logs to store in Amazon S3 or Amazon Data Firehose. Log events in log groups in the Delivery class are kept in CloudWatch Logs for only one day. This log class doesn't offer rich CloudWatch Logs capabilities such as CloudWatch Logs Insights queries.
If you omit this parameter, the default of `STANDARD` is used.  
The value of `logGroupClass` can't be changed after a log group is created.
For details about the features supported by each class, see [Log classes](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch_Logs_Log_Classes.html)   
Type: String  
Valid Values: `STANDARD | INFREQUENT_ACCESS | DELIVERY`   
Required: No

 ** [logGroupName](#API_CreateLogGroup_RequestSyntax) **   <a name="CWL-CreateLogGroup-request-logGroupName"></a>
A name for the log group.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[\.\-_/#A-Za-z0-9]+`   
Required: Yes

 ** [tags](#API_CreateLogGroup_RequestSyntax) **   <a name="CWL-CreateLogGroup-request-tags"></a>
The key-value pairs to use for the tags.  
You can grant users access to certain log groups while preventing them from accessing other log groups. To do so, tag your groups and use IAM policies that refer to those tags. To assign tags when you create a log group, you must have either the `logs:TagResource` or `logs:TagLogGroup` permission. For more information about tagging, see [Tagging AWS resources](https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html). For more information about using tags to control access, see [Controlling access to Amazon Web Services resources using tags](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_tags.html).  
Type: String to string map  
Map Entries: Maximum number of 50 items.  
Key Length Constraints: Minimum length of 1. Maximum length of 128.  
Key Pattern: `^([\p{L}\p{Z}\p{N}_.:/=+\-@]+)$`   
Value Length Constraints: Maximum length of 256.  
Value Pattern: `^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$`   
Required: No

## Response Elements
<a name="API_CreateLogGroup_ResponseElements"></a>

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

## Errors
<a name="API_CreateLogGroup_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** LimitExceededException **   
You have reached the maximum number of resources that can be created.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
HTTP Status Code: 400

 ** ResourceAlreadyExistsException **   
The specified resource already exists.  
HTTP Status Code: 400

 ** ServiceUnavailableException **   
The service cannot complete the request.  
HTTP Status Code: 500

## Examples
<a name="API_CreateLogGroup_Examples"></a>

### To create a log group
<a name="API_CreateLogGroup_Example_1"></a>

The following example creates a log group.

#### Sample Request
<a name="API_CreateLogGroup_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.CreateLogGroup
{
  "logGroupName": "my-log-group",
  "kmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/abcd1234-a123-456a-a12b-a123b456c789"
}
```

#### Sample Response
<a name="API_CreateLogGroup_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
```

## See Also
<a name="API_CreateLogGroup_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/CreateLogGroup) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/CreateLogGroup) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/CreateLogGroup) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/CreateLogGroup) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/CreateLogGroup) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/CreateLogGroup) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/CreateLogGroup) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/CreateLogGroup) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/CreateLogGroup) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/CreateLogGroup) 

# CreateLogStream
<a name="API_CreateLogStream"></a>

Creates a log stream for the specified log group. A log stream is a sequence of log events that originate from a single source, such as an application instance or a resource that is being monitored.

There is no limit on the number of log streams that you can create for a log group. There is a limit of 50 TPS on `CreateLogStream` operations, after which transactions are throttled.

You must use the following guidelines when naming a log stream:
+ Log stream names must be unique within the log group.
+ Log stream names can be between 1 and 512 characters long.
+ Don't use ':' (colon) or '\$1' (asterisk) characters.

## Request Syntax
<a name="API_CreateLogStream_RequestSyntax"></a>

```
{
   "logGroupName": "string",
   "logStreamName": "string"
}
```

## Request Parameters
<a name="API_CreateLogStream_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [logGroupName](#API_CreateLogStream_RequestSyntax) **   <a name="CWL-CreateLogStream-request-logGroupName"></a>
The name of the log group.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[\.\-_/#A-Za-z0-9]+`   
Required: Yes

 ** [logStreamName](#API_CreateLogStream_RequestSyntax) **   <a name="CWL-CreateLogStream-request-logStreamName"></a>
The name of the log stream.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[^:*]*`   
Required: Yes

## Response Elements
<a name="API_CreateLogStream_ResponseElements"></a>

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

## Errors
<a name="API_CreateLogStream_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** ResourceAlreadyExistsException **   
The specified resource already exists.  
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
<a name="API_CreateLogStream_Examples"></a>

### To create a log stream
<a name="API_CreateLogStream_Example_1"></a>

The following example creates a log stream for the specified log group.

#### Sample Request
<a name="API_CreateLogStream_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.CreateLogStream
{
  "logGroupName": "my-log-group",
  "logStreamName": "my-log-stream"
}
```

#### Sample Response
<a name="API_CreateLogStream_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
```

## See Also
<a name="API_CreateLogStream_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/CreateLogStream) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/CreateLogStream) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/CreateLogStream) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/CreateLogStream) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/CreateLogStream) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/CreateLogStream) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/CreateLogStream) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/CreateLogStream) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/CreateLogStream) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/CreateLogStream) 

# CreateLookupTable
<a name="API_CreateLookupTable"></a>

Creates a lookup table by uploading CSV data. You can use lookup tables to enrich log data in CloudWatch Logs Insights queries with reference data such as user details, application names, or error descriptions.

The table name must be unique within your account and Region. The CSV content must include a header row with column names, use UTF-8 encoding, and not exceed 10 MB.

## Request Syntax
<a name="API_CreateLookupTable_RequestSyntax"></a>

```
{
   "description": "string",
   "kmsKeyId": "string",
   "lookupTableName": "string",
   "tableBody": "string",
   "tags": { 
      "string" : "string" 
   }
}
```

## Request Parameters
<a name="API_CreateLookupTable_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [description](#API_CreateLookupTable_RequestSyntax) **   <a name="CWL-CreateLookupTable-request-description"></a>
A description of the lookup table. The description can be up to 1024 characters long.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Required: No

 ** [kmsKeyId](#API_CreateLookupTable_RequestSyntax) **   <a name="CWL-CreateLookupTable-request-kmsKeyId"></a>
The ARN of the AWS KMS key to use to encrypt the lookup table data. If you don't specify a key, the data is encrypted with an AWS-owned key.  
Type: String  
Length Constraints: Maximum length of 256.  
Required: No

 ** [lookupTableName](#API_CreateLookupTable_RequestSyntax) **   <a name="CWL-CreateLookupTable-request-lookupTableName"></a>
The name of the lookup table. The name must be unique within your account and Region. The name can contain only alphanumeric characters and underscores, and can be up to 256 characters long.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 256.  
Pattern: `^[a-zA-Z0-9_]+$`   
Required: Yes

 ** [tableBody](#API_CreateLookupTable_RequestSyntax) **   <a name="CWL-CreateLookupTable-request-tableBody"></a>
The CSV content of the lookup table. The first row must be a header row with column names. The content must use UTF-8 encoding and not exceed 10 MB.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 10485760.  
Required: Yes

 ** [tags](#API_CreateLookupTable_RequestSyntax) **   <a name="CWL-CreateLookupTable-request-tags"></a>
A list of key-value pairs to associate with the lookup table. You can associate as many as 50 tags with a lookup table. Tags can help you organize and categorize your resources.  
Type: String to string map  
Map Entries: Maximum number of 50 items.  
Key Length Constraints: Minimum length of 1. Maximum length of 128.  
Key Pattern: `^([\p{L}\p{Z}\p{N}_.:/=+\-@]+)$`   
Value Length Constraints: Maximum length of 256.  
Value Pattern: `^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$`   
Required: No

## Response Syntax
<a name="API_CreateLookupTable_ResponseSyntax"></a>

```
{
   "createdAt": number,
   "lookupTableArn": "string"
}
```

## Response Elements
<a name="API_CreateLookupTable_ResponseElements"></a>

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

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

 ** [createdAt](#API_CreateLookupTable_ResponseSyntax) **   <a name="CWL-CreateLookupTable-response-createdAt"></a>
The time when the lookup table was created, expressed as the number of milliseconds after `Jan 1, 1970 00:00:00 UTC`.  
Type: Long  
Valid Range: Minimum value of 0.

 ** [lookupTableArn](#API_CreateLookupTable_ResponseSyntax) **   <a name="CWL-CreateLookupTable-response-lookupTableArn"></a>
The ARN of the lookup table that was created.  
Type: String

## Errors
<a name="API_CreateLookupTable_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have sufficient permissions to perform this action.  
HTTP Status Code: 400

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** LimitExceededException **   
You have reached the maximum number of resources that can be created.  
HTTP Status Code: 400

 ** ResourceAlreadyExistsException **   
The specified resource already exists.  
HTTP Status Code: 400

 ** ServiceUnavailableException **   
The service cannot complete the request.  
HTTP Status Code: 500

 ** ValidationException **   
One of the parameters for the request is not valid.  
HTTP Status Code: 400

## See Also
<a name="API_CreateLookupTable_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/CreateLookupTable) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/CreateLookupTable) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/CreateLookupTable) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/CreateLookupTable) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/CreateLookupTable) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/CreateLookupTable) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/CreateLookupTable) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/CreateLookupTable) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/CreateLookupTable) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/CreateLookupTable) 

# CreateScheduledQuery
<a name="API_CreateScheduledQuery"></a>

Creates a scheduled query that runs CloudWatch Logs Insights queries at regular intervals. Scheduled queries enable proactive monitoring by automatically executing queries to detect patterns and anomalies in your log data. Query results can be delivered to Amazon S3 for analysis or further processing.

## Request Syntax
<a name="API_CreateScheduledQuery_RequestSyntax"></a>

```
{
   "description": "string",
   "destinationConfiguration": { 
      "s3Configuration": { 
         "destinationIdentifier": "string",
         "kmsKeyId": "string",
         "ownerAccountId": "string",
         "roleArn": "string"
      }
   },
   "executionRoleArn": "string",
   "logGroupIdentifiers": [ "string" ],
   "name": "string",
   "queryLanguage": "string",
   "queryString": "string",
   "scheduleEndTime": number,
   "scheduleExpression": "string",
   "scheduleStartTime": number,
   "startTimeOffset": number,
   "state": "string",
   "tags": { 
      "string" : "string" 
   },
   "timezone": "string"
}
```

## Request Parameters
<a name="API_CreateScheduledQuery_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [description](#API_CreateScheduledQuery_RequestSyntax) **   <a name="CWL-CreateScheduledQuery-request-description"></a>
An optional description for the scheduled query to help identify its purpose and functionality.  
Type: String  
Length Constraints: Maximum length of 1024.  
Required: No

 ** [destinationConfiguration](#API_CreateScheduledQuery_RequestSyntax) **   <a name="CWL-CreateScheduledQuery-request-destinationConfiguration"></a>
Configuration for where to deliver query results. Currently supports Amazon S3 destinations for storing query output.  
Type: [DestinationConfiguration](API_DestinationConfiguration.md) object  
Required: No

 ** [executionRoleArn](#API_CreateScheduledQuery_RequestSyntax) **   <a name="CWL-CreateScheduledQuery-request-executionRoleArn"></a>
The ARN of the IAM role that grants permissions to execute the query and deliver results to the specified destination. The role must have permissions to read from the specified log groups and write to the destination.  
Type: String  
Length Constraints: Minimum length of 1.  
Required: Yes

 ** [logGroupIdentifiers](#API_CreateScheduledQuery_RequestSyntax) **   <a name="CWL-CreateScheduledQuery-request-logGroupIdentifiers"></a>
An array of log group names or ARNs to query. You can specify between 1 and 50 log groups. Log groups can be identified by name or full ARN.  
Type: Array of strings  
Array Members: Minimum number of 1 item. Maximum number of 50 items.  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Pattern: `[\w#+=/:,.@-]*`   
Required: No

 ** [name](#API_CreateScheduledQuery_RequestSyntax) **   <a name="CWL-CreateScheduledQuery-request-name"></a>
The name of the scheduled query. The name must be unique within your account and region. Valid characters are alphanumeric characters, hyphens, underscores, and periods. Length must be between 1 and 255 characters.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 255.  
Pattern: `^[a-zA-Z0-9_\-/.#]+$`   
Required: Yes

 ** [queryLanguage](#API_CreateScheduledQuery_RequestSyntax) **   <a name="CWL-CreateScheduledQuery-request-queryLanguage"></a>
The query language to use for the scheduled query. Valid values are `CWLI`, `PPL`, and `SQL`.  
Type: String  
Valid Values: `CWLI | SQL | PPL`   
Required: Yes

 ** [queryString](#API_CreateScheduledQuery_RequestSyntax) **   <a name="CWL-CreateScheduledQuery-request-queryString"></a>
The query string to execute. This is the same query syntax used in CloudWatch Logs Insights. Maximum length is 10,000 characters.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 10000.  
Required: Yes

 ** [scheduleEndTime](#API_CreateScheduledQuery_RequestSyntax) **   <a name="CWL-CreateScheduledQuery-request-scheduleEndTime"></a>
The end time for the scheduled query in Unix epoch format. The query will stop executing after this time.  
Type: Long  
Valid Range: Minimum value of 0.  
Required: No

 ** [scheduleExpression](#API_CreateScheduledQuery_RequestSyntax) **   <a name="CWL-CreateScheduledQuery-request-scheduleExpression"></a>
A cron expression that defines when the scheduled query runs. The expression uses standard cron syntax and supports minute-level precision. Maximum length is 256 characters.  
Type: String  
Length Constraints: Maximum length of 256.  
Required: Yes

 ** [scheduleStartTime](#API_CreateScheduledQuery_RequestSyntax) **   <a name="CWL-CreateScheduledQuery-request-scheduleStartTime"></a>
The start time for the scheduled query in Unix epoch format. The query will not execute before this time.  
Type: Long  
Valid Range: Minimum value of 0.  
Required: No

 ** [startTimeOffset](#API_CreateScheduledQuery_RequestSyntax) **   <a name="CWL-CreateScheduledQuery-request-startTimeOffset"></a>
The time offset in seconds that defines the lookback period for the query. This determines how far back in time the query searches from the execution time.  
Type: Long  
Required: No

 ** [state](#API_CreateScheduledQuery_RequestSyntax) **   <a name="CWL-CreateScheduledQuery-request-state"></a>
The initial state of the scheduled query. Valid values are `ENABLED` and `DISABLED`. Default is `ENABLED`.  
Type: String  
Valid Values: `ENABLED | DISABLED`   
Required: No

 ** [tags](#API_CreateScheduledQuery_RequestSyntax) **   <a name="CWL-CreateScheduledQuery-request-tags"></a>
Key-value pairs to associate with the scheduled query for resource management and cost allocation.  
Type: String to string map  
Map Entries: Maximum number of 50 items.  
Key Length Constraints: Minimum length of 1. Maximum length of 128.  
Key Pattern: `^([\p{L}\p{Z}\p{N}_.:/=+\-@]+)$`   
Value Length Constraints: Maximum length of 256.  
Value Pattern: `^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$`   
Required: No

 ** [timezone](#API_CreateScheduledQuery_RequestSyntax) **   <a name="CWL-CreateScheduledQuery-request-timezone"></a>
The timezone for evaluating the schedule expression. This determines when the scheduled query executes relative to the specified timezone.  
Type: String  
Length Constraints: Minimum length of 1.  
Required: No

## Response Syntax
<a name="API_CreateScheduledQuery_ResponseSyntax"></a>

```
{
   "scheduledQueryArn": "string",
   "state": "string"
}
```

## Response Elements
<a name="API_CreateScheduledQuery_ResponseElements"></a>

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

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

 ** [scheduledQueryArn](#API_CreateScheduledQuery_ResponseSyntax) **   <a name="CWL-CreateScheduledQuery-response-scheduledQueryArn"></a>
The ARN of the created scheduled query.  
Type: String

 ** [state](#API_CreateScheduledQuery_ResponseSyntax) **   <a name="CWL-CreateScheduledQuery-response-state"></a>
The current state of the scheduled query.  
Type: String  
Valid Values: `ENABLED | DISABLED` 

## Errors
<a name="API_CreateScheduledQuery_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have sufficient permissions to perform this action.  
HTTP Status Code: 400

 ** ConflictException **   
This operation attempted to create a resource that already exists.  
HTTP Status Code: 400

 ** InternalServerException **   
An internal server error occurred while processing the request. This exception is returned when the service encounters an unexpected condition that prevents it from fulfilling the request.  
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The specified resource does not exist.  
HTTP Status Code: 400

 ** ServiceQuotaExceededException **   
This request exceeds a service quota.  
HTTP Status Code: 400

 ** ThrottlingException **   
The request was throttled because of quota limits.  
HTTP Status Code: 400

 ** ValidationException **   
One of the parameters for the request is not valid.  
HTTP Status Code: 400

## See Also
<a name="API_CreateScheduledQuery_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/CreateScheduledQuery) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/CreateScheduledQuery) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/CreateScheduledQuery) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/CreateScheduledQuery) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/CreateScheduledQuery) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/CreateScheduledQuery) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/CreateScheduledQuery) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/CreateScheduledQuery) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/CreateScheduledQuery) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/CreateScheduledQuery) 

# DeleteAccountPolicy
<a name="API_DeleteAccountPolicy"></a>

Deletes a CloudWatch Logs account policy. This stops the account-wide policy from applying to log groups or data sources in the account. If you delete a data protection policy or subscription filter policy, any log-group level policies of those types remain in effect. This operation supports deletion of data source-based field index policies, including facet configurations, in addition to log group-based policies.

To use this operation, you must be signed on with the correct permissions depending on the type of policy that you are deleting.
+ To delete a data protection policy, you must have the `logs:DeleteDataProtectionPolicy` and `logs:DeleteAccountPolicy` permissions.
+ To delete a subscription filter policy, you must have the `logs:DeleteSubscriptionFilter` and `logs:DeleteAccountPolicy` permissions.
+ To delete a transformer policy, you must have the `logs:DeleteTransformer` and `logs:DeleteAccountPolicy` permissions.
+ To delete a field index policy, you must have the `logs:DeleteIndexPolicy` and `logs:DeleteAccountPolicy` permissions.

  If you delete a field index policy that included facet configurations, those facets will no longer be available for interactive exploration in the CloudWatch Logs Insights console. However, facet data is retained for up to 30 days.

If you delete a field index policy, the indexing of the log events that happened before you deleted the policy will still be used for up to 30 days to improve CloudWatch Logs Insights queries.

## Request Syntax
<a name="API_DeleteAccountPolicy_RequestSyntax"></a>

```
{
   "policyName": "string",
   "policyType": "string"
}
```

## Request Parameters
<a name="API_DeleteAccountPolicy_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [policyName](#API_DeleteAccountPolicy_RequestSyntax) **   <a name="CWL-DeleteAccountPolicy-request-policyName"></a>
The name of the policy to delete.  
Type: String  
Required: Yes

 ** [policyType](#API_DeleteAccountPolicy_RequestSyntax) **   <a name="CWL-DeleteAccountPolicy-request-policyType"></a>
The type of policy to delete.  
Type: String  
Valid Values: `DATA_PROTECTION_POLICY | SUBSCRIPTION_FILTER_POLICY | FIELD_INDEX_POLICY | TRANSFORMER_POLICY | METRIC_EXTRACTION_POLICY`   
Required: Yes

## Response Elements
<a name="API_DeleteAccountPolicy_ResponseElements"></a>

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

## Errors
<a name="API_DeleteAccountPolicy_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
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

## See Also
<a name="API_DeleteAccountPolicy_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DeleteAccountPolicy) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DeleteAccountPolicy) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DeleteAccountPolicy) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DeleteAccountPolicy) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DeleteAccountPolicy) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DeleteAccountPolicy) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DeleteAccountPolicy) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DeleteAccountPolicy) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DeleteAccountPolicy) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DeleteAccountPolicy) 

# DeleteDataProtectionPolicy
<a name="API_DeleteDataProtectionPolicy"></a>

Deletes the data protection policy from the specified log group. 

For more information about data protection policies, see [PutDataProtectionPolicy](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDataProtectionPolicy.html).

## Request Syntax
<a name="API_DeleteDataProtectionPolicy_RequestSyntax"></a>

```
{
   "logGroupIdentifier": "string"
}
```

## Request Parameters
<a name="API_DeleteDataProtectionPolicy_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [logGroupIdentifier](#API_DeleteDataProtectionPolicy_RequestSyntax) **   <a name="CWL-DeleteDataProtectionPolicy-request-logGroupIdentifier"></a>
The name or ARN of the log group that you want to delete the data protection policy for.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Pattern: `[\w#+=/:,.@-]*`   
Required: Yes

## Response Elements
<a name="API_DeleteDataProtectionPolicy_ResponseElements"></a>

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

## Errors
<a name="API_DeleteDataProtectionPolicy_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
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

## See Also
<a name="API_DeleteDataProtectionPolicy_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DeleteDataProtectionPolicy) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DeleteDataProtectionPolicy) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DeleteDataProtectionPolicy) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DeleteDataProtectionPolicy) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DeleteDataProtectionPolicy) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DeleteDataProtectionPolicy) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DeleteDataProtectionPolicy) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DeleteDataProtectionPolicy) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DeleteDataProtectionPolicy) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DeleteDataProtectionPolicy) 

# DeleteDelivery
<a name="API_DeleteDelivery"></a>

Deletes a *delivery*. A delivery is a connection between a logical *delivery source* and a logical *delivery destination*. Deleting a delivery only deletes the connection between the delivery source and delivery destination. It does not delete the delivery destination or the delivery source.

## Request Syntax
<a name="API_DeleteDelivery_RequestSyntax"></a>

```
{
   "id": "string"
}
```

## Request Parameters
<a name="API_DeleteDelivery_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [id](#API_DeleteDelivery_RequestSyntax) **   <a name="CWL-DeleteDelivery-request-id"></a>
The unique ID of the delivery to delete. You can find the ID of a delivery with the [DescribeDeliveries](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeDeliveries.html) operation.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 64.  
Pattern: `^[0-9A-Za-z]+$`   
Required: Yes

## Response Elements
<a name="API_DeleteDelivery_ResponseElements"></a>

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

## Errors
<a name="API_DeleteDelivery_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ConflictException **   
This operation attempted to create a resource that already exists.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
The specified resource does not exist.  
HTTP Status Code: 400

 ** ServiceQuotaExceededException **   
This request exceeds a service quota.  
HTTP Status Code: 400

 ** ServiceUnavailableException **   
The service cannot complete the request.  
HTTP Status Code: 500

 ** ThrottlingException **   
The request was throttled because of quota limits.  
HTTP Status Code: 400

 ** ValidationException **   
One of the parameters for the request is not valid.  
HTTP Status Code: 400

## See Also
<a name="API_DeleteDelivery_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DeleteDelivery) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DeleteDelivery) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DeleteDelivery) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DeleteDelivery) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DeleteDelivery) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DeleteDelivery) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DeleteDelivery) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DeleteDelivery) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DeleteDelivery) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DeleteDelivery) 

# DeleteDeliveryDestination
<a name="API_DeleteDeliveryDestination"></a>

Deletes a *delivery destination*. A delivery is a connection between a logical *delivery source* and a logical *delivery destination*.

You can't delete a delivery destination if any current deliveries are associated with it. To find whether any deliveries are associated with this delivery destination, use the [DescribeDeliveries](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeDeliveries.html) operation and check the `deliveryDestinationArn` field in the results.

## Request Syntax
<a name="API_DeleteDeliveryDestination_RequestSyntax"></a>

```
{
   "name": "string"
}
```

## Request Parameters
<a name="API_DeleteDeliveryDestination_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [name](#API_DeleteDeliveryDestination_RequestSyntax) **   <a name="CWL-DeleteDeliveryDestination-request-name"></a>
The name of the delivery destination that you want to delete. You can find a list of delivery destination names by using the [DescribeDeliveryDestinations](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeDeliveryDestinations.html) operation.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 60.  
Pattern: `[\w-]*`   
Required: Yes

## Response Elements
<a name="API_DeleteDeliveryDestination_ResponseElements"></a>

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

## Errors
<a name="API_DeleteDeliveryDestination_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ConflictException **   
This operation attempted to create a resource that already exists.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
The specified resource does not exist.  
HTTP Status Code: 400

 ** ServiceQuotaExceededException **   
This request exceeds a service quota.  
HTTP Status Code: 400

 ** ServiceUnavailableException **   
The service cannot complete the request.  
HTTP Status Code: 500

 ** ThrottlingException **   
The request was throttled because of quota limits.  
HTTP Status Code: 400

 ** ValidationException **   
One of the parameters for the request is not valid.  
HTTP Status Code: 400

## See Also
<a name="API_DeleteDeliveryDestination_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DeleteDeliveryDestination) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DeleteDeliveryDestination) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DeleteDeliveryDestination) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DeleteDeliveryDestination) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DeleteDeliveryDestination) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DeleteDeliveryDestination) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DeleteDeliveryDestination) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DeleteDeliveryDestination) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DeleteDeliveryDestination) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DeleteDeliveryDestination) 

# DeleteDeliveryDestinationPolicy
<a name="API_DeleteDeliveryDestinationPolicy"></a>

Deletes a delivery destination policy. For more information about these policies, see [PutDeliveryDestinationPolicy](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliveryDestinationPolicy.html).

## Request Syntax
<a name="API_DeleteDeliveryDestinationPolicy_RequestSyntax"></a>

```
{
   "deliveryDestinationName": "string"
}
```

## Request Parameters
<a name="API_DeleteDeliveryDestinationPolicy_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [deliveryDestinationName](#API_DeleteDeliveryDestinationPolicy_RequestSyntax) **   <a name="CWL-DeleteDeliveryDestinationPolicy-request-deliveryDestinationName"></a>
The name of the delivery destination that you want to delete the policy for.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 60.  
Pattern: `[\w-]*`   
Required: Yes

## Response Elements
<a name="API_DeleteDeliveryDestinationPolicy_ResponseElements"></a>

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

## Errors
<a name="API_DeleteDeliveryDestinationPolicy_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ConflictException **   
This operation attempted to create a resource that already exists.  
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

 ** ValidationException **   
One of the parameters for the request is not valid.  
HTTP Status Code: 400

## See Also
<a name="API_DeleteDeliveryDestinationPolicy_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DeleteDeliveryDestinationPolicy) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DeleteDeliveryDestinationPolicy) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DeleteDeliveryDestinationPolicy) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DeleteDeliveryDestinationPolicy) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DeleteDeliveryDestinationPolicy) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DeleteDeliveryDestinationPolicy) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DeleteDeliveryDestinationPolicy) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DeleteDeliveryDestinationPolicy) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DeleteDeliveryDestinationPolicy) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DeleteDeliveryDestinationPolicy) 

# DeleteDeliverySource
<a name="API_DeleteDeliverySource"></a>

Deletes a *delivery source*. A delivery is a connection between a logical *delivery source* and a logical *delivery destination*.

You can't delete a delivery source if any current deliveries are associated with it. To find whether any deliveries are associated with this delivery source, use the [DescribeDeliveries](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeDeliveries.html) operation and check the `deliverySourceName` field in the results.

## Request Syntax
<a name="API_DeleteDeliverySource_RequestSyntax"></a>

```
{
   "name": "string"
}
```

## Request Parameters
<a name="API_DeleteDeliverySource_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [name](#API_DeleteDeliverySource_RequestSyntax) **   <a name="CWL-DeleteDeliverySource-request-name"></a>
The name of the delivery source that you want to delete.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 60.  
Pattern: `[\w-]*`   
Required: Yes

## Response Elements
<a name="API_DeleteDeliverySource_ResponseElements"></a>

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

## Errors
<a name="API_DeleteDeliverySource_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ConflictException **   
This operation attempted to create a resource that already exists.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
The specified resource does not exist.  
HTTP Status Code: 400

 ** ServiceQuotaExceededException **   
This request exceeds a service quota.  
HTTP Status Code: 400

 ** ServiceUnavailableException **   
The service cannot complete the request.  
HTTP Status Code: 500

 ** ThrottlingException **   
The request was throttled because of quota limits.  
HTTP Status Code: 400

 ** ValidationException **   
One of the parameters for the request is not valid.  
HTTP Status Code: 400

## See Also
<a name="API_DeleteDeliverySource_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DeleteDeliverySource) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DeleteDeliverySource) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DeleteDeliverySource) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DeleteDeliverySource) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DeleteDeliverySource) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DeleteDeliverySource) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DeleteDeliverySource) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DeleteDeliverySource) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DeleteDeliverySource) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DeleteDeliverySource) 

# DeleteDestination
<a name="API_DeleteDestination"></a>

Deletes the specified destination, and eventually disables all the subscription filters that publish to it. This operation does not delete the physical resource encapsulated by the destination.

## Request Syntax
<a name="API_DeleteDestination_RequestSyntax"></a>

```
{
   "destinationName": "string"
}
```

## Request Parameters
<a name="API_DeleteDestination_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [destinationName](#API_DeleteDestination_RequestSyntax) **   <a name="CWL-DeleteDestination-request-destinationName"></a>
The name of the destination.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[^:*]*`   
Required: Yes

## Response Elements
<a name="API_DeleteDestination_ResponseElements"></a>

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

## Errors
<a name="API_DeleteDestination_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
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
<a name="API_DeleteDestination_Examples"></a>

### To delete a destination
<a name="API_DeleteDestination_Example_1"></a>

The following example deletes the specified destination.

#### Sample Request
<a name="API_DeleteDestination_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.DeleteDestination
{
  "destinationName": my-destination"
}
```

#### Sample Response
<a name="API_DeleteDestination_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
```

## See Also
<a name="API_DeleteDestination_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DeleteDestination) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DeleteDestination) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DeleteDestination) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DeleteDestination) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DeleteDestination) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DeleteDestination) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DeleteDestination) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DeleteDestination) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DeleteDestination) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DeleteDestination) 

# DeleteIndexPolicy
<a name="API_DeleteIndexPolicy"></a>

Deletes a log-group level field index policy that was applied to a single log group. The indexing of the log events that happened before you delete the policy will still be used for as many as 30 days to improve CloudWatch Logs Insights queries.

If the deleted policy included facet configurations, those facets will no longer be available for interactive exploration in the CloudWatch Logs Insights console for this log group. However, facet data is retained for up to 30 days.

You can't use this operation to delete an account-level index policy. Instead, use [DeleteAccountPolicy](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DeleteAccountPolicy.html).

If you delete a log-group level field index policy and there is an account-level field index policy, in a few minutes the log group begins using that account-wide policy to index new incoming log events. This operation only affects log group-level policies, including any facet configurations, and preserves any data source-based account policies that may apply to the log group.

## Request Syntax
<a name="API_DeleteIndexPolicy_RequestSyntax"></a>

```
{
   "logGroupIdentifier": "string"
}
```

## Request Parameters
<a name="API_DeleteIndexPolicy_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [logGroupIdentifier](#API_DeleteIndexPolicy_RequestSyntax) **   <a name="CWL-DeleteIndexPolicy-request-logGroupIdentifier"></a>
The log group to delete the index policy for. You can specify either the name or the ARN of the log group.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Pattern: `[\w#+=/:,.@-]*`   
Required: Yes

## Response Elements
<a name="API_DeleteIndexPolicy_ResponseElements"></a>

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

## Errors
<a name="API_DeleteIndexPolicy_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** LimitExceededException **   
You have reached the maximum number of resources that can be created.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
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

## See Also
<a name="API_DeleteIndexPolicy_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DeleteIndexPolicy) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DeleteIndexPolicy) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DeleteIndexPolicy) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DeleteIndexPolicy) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DeleteIndexPolicy) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DeleteIndexPolicy) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DeleteIndexPolicy) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DeleteIndexPolicy) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DeleteIndexPolicy) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DeleteIndexPolicy) 

# DeleteIntegration
<a name="API_DeleteIntegration"></a>

Deletes the integration between CloudWatch Logs and OpenSearch Service. If your integration has active vended logs dashboards, you must specify `true` for the `force` parameter, otherwise the operation will fail. If you delete the integration by setting `force` to `true`, all your vended logs dashboards powered by OpenSearch Service will be deleted and the data that was on them will no longer be accessible.

## Request Syntax
<a name="API_DeleteIntegration_RequestSyntax"></a>

```
{
   "force": boolean,
   "integrationName": "string"
}
```

## Request Parameters
<a name="API_DeleteIntegration_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [force](#API_DeleteIntegration_RequestSyntax) **   <a name="CWL-DeleteIntegration-request-force"></a>
Specify `true` to force the deletion of the integration even if vended logs dashboards currently exist.  
The default is `false`.  
Type: Boolean  
Required: No

 ** [integrationName](#API_DeleteIntegration_RequestSyntax) **   <a name="CWL-DeleteIntegration-request-integrationName"></a>
The name of the integration to delete. To find the name of your integration, use [ListIntegrations](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_ListIntegrations.html).  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 50.  
Pattern: `[\.\-_/#A-Za-z0-9]+`   
Required: Yes

## Response Elements
<a name="API_DeleteIntegration_ResponseElements"></a>

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

## Errors
<a name="API_DeleteIntegration_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** 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

 ** ValidationException **   
One of the parameters for the request is not valid.  
HTTP Status Code: 400

## See Also
<a name="API_DeleteIntegration_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DeleteIntegration) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DeleteIntegration) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DeleteIntegration) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DeleteIntegration) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DeleteIntegration) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DeleteIntegration) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DeleteIntegration) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DeleteIntegration) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DeleteIntegration) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DeleteIntegration) 

# DeleteLogAnomalyDetector
<a name="API_DeleteLogAnomalyDetector"></a>

Deletes the specified CloudWatch Logs anomaly detector.

## Request Syntax
<a name="API_DeleteLogAnomalyDetector_RequestSyntax"></a>

```
{
   "anomalyDetectorArn": "string"
}
```

## Request Parameters
<a name="API_DeleteLogAnomalyDetector_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [anomalyDetectorArn](#API_DeleteLogAnomalyDetector_RequestSyntax) **   <a name="CWL-DeleteLogAnomalyDetector-request-anomalyDetectorArn"></a>
The ARN of the anomaly detector to delete. You can find the ARNs of log anomaly detectors in your account by using the [ListLogAnomalyDetectors](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_ListLogAnomalyDetectors.html) operation.  
Type: String  
Length Constraints: Minimum length of 1.  
Pattern: `[\w#+=/:,.@-]*`   
Required: Yes

## Response Elements
<a name="API_DeleteLogAnomalyDetector_ResponseElements"></a>

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

## Errors
<a name="API_DeleteLogAnomalyDetector_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
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

## See Also
<a name="API_DeleteLogAnomalyDetector_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DeleteLogAnomalyDetector) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DeleteLogAnomalyDetector) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DeleteLogAnomalyDetector) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DeleteLogAnomalyDetector) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DeleteLogAnomalyDetector) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DeleteLogAnomalyDetector) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DeleteLogAnomalyDetector) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DeleteLogAnomalyDetector) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DeleteLogAnomalyDetector) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DeleteLogAnomalyDetector) 

# DeleteLogGroup
<a name="API_DeleteLogGroup"></a>

Deletes the specified log group and permanently deletes all the archived log events associated with the log group.

## Request Syntax
<a name="API_DeleteLogGroup_RequestSyntax"></a>

```
{
   "logGroupName": "string"
}
```

## Request Parameters
<a name="API_DeleteLogGroup_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [logGroupName](#API_DeleteLogGroup_RequestSyntax) **   <a name="CWL-DeleteLogGroup-request-logGroupName"></a>
The name of the log group.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[\.\-_/#A-Za-z0-9]+`   
Required: Yes

## Response Elements
<a name="API_DeleteLogGroup_ResponseElements"></a>

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

## Errors
<a name="API_DeleteLogGroup_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
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

 ** ValidationException **   
One of the parameters for the request is not valid.  
HTTP Status Code: 400

## Examples
<a name="API_DeleteLogGroup_Examples"></a>

### To delete a log group
<a name="API_DeleteLogGroup_Example_1"></a>

The following example deletes the specified log group.

#### Sample Request
<a name="API_DeleteLogGroup_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.DeleteLogGroup
{
  "logGroupName": "my-log-group"
}
```

#### Sample Response
<a name="API_DeleteLogGroup_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
```

## See Also
<a name="API_DeleteLogGroup_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DeleteLogGroup) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DeleteLogGroup) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DeleteLogGroup) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DeleteLogGroup) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DeleteLogGroup) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DeleteLogGroup) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DeleteLogGroup) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DeleteLogGroup) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DeleteLogGroup) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DeleteLogGroup) 

# DeleteLogStream
<a name="API_DeleteLogStream"></a>

Deletes the specified log stream and permanently deletes all the archived log events associated with the log stream.

## Request Syntax
<a name="API_DeleteLogStream_RequestSyntax"></a>

```
{
   "logGroupName": "string",
   "logStreamName": "string"
}
```

## Request Parameters
<a name="API_DeleteLogStream_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [logGroupName](#API_DeleteLogStream_RequestSyntax) **   <a name="CWL-DeleteLogStream-request-logGroupName"></a>
The name of the log group.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[\.\-_/#A-Za-z0-9]+`   
Required: Yes

 ** [logStreamName](#API_DeleteLogStream_RequestSyntax) **   <a name="CWL-DeleteLogStream-request-logStreamName"></a>
The name of the log stream.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[^:*]*`   
Required: Yes

## Response Elements
<a name="API_DeleteLogStream_ResponseElements"></a>

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

## Errors
<a name="API_DeleteLogStream_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
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

 ** ValidationException **   
One of the parameters for the request is not valid.  
HTTP Status Code: 400

## Examples
<a name="API_DeleteLogStream_Examples"></a>

### To delete a log stream
<a name="API_DeleteLogStream_Example_1"></a>

The following example deletes the specified log stream.

#### Sample Request
<a name="API_DeleteLogStream_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.DeleteLogStream
{
  "logGroupName": "my-log-group",
  "logStreamName": "my-log-stream"
}
```

#### Sample Response
<a name="API_DeleteLogStream_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
```

## See Also
<a name="API_DeleteLogStream_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DeleteLogStream) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DeleteLogStream) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DeleteLogStream) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DeleteLogStream) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DeleteLogStream) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DeleteLogStream) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DeleteLogStream) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DeleteLogStream) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DeleteLogStream) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DeleteLogStream) 

# DeleteLookupTable
<a name="API_DeleteLookupTable"></a>

Deletes a lookup table permanently. This operation cannot be undone.

Queries that reference a deleted table will return an error. Before deleting a lookup table, review any saved queries or dashboards that may reference it.

## Request Syntax
<a name="API_DeleteLookupTable_RequestSyntax"></a>

```
{
   "lookupTableArn": "string"
}
```

## Request Parameters
<a name="API_DeleteLookupTable_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [lookupTableArn](#API_DeleteLookupTable_RequestSyntax) **   <a name="CWL-DeleteLookupTable-request-lookupTableArn"></a>
The ARN of the lookup table to delete.  
Type: String  
Required: Yes

## Response Elements
<a name="API_DeleteLookupTable_ResponseElements"></a>

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

## Errors
<a name="API_DeleteLookupTable_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have sufficient permissions to perform this action.  
HTTP Status Code: 400

 ** 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

## See Also
<a name="API_DeleteLookupTable_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DeleteLookupTable) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DeleteLookupTable) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DeleteLookupTable) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DeleteLookupTable) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DeleteLookupTable) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DeleteLookupTable) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DeleteLookupTable) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DeleteLookupTable) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DeleteLookupTable) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DeleteLookupTable) 

# DeleteMetricFilter
<a name="API_DeleteMetricFilter"></a>

Deletes the specified metric filter.

## Request Syntax
<a name="API_DeleteMetricFilter_RequestSyntax"></a>

```
{
   "filterName": "string",
   "logGroupName": "string"
}
```

## Request Parameters
<a name="API_DeleteMetricFilter_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [filterName](#API_DeleteMetricFilter_RequestSyntax) **   <a name="CWL-DeleteMetricFilter-request-filterName"></a>
The name of the metric filter.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[^:*]*`   
Required: Yes

 ** [logGroupName](#API_DeleteMetricFilter_RequestSyntax) **   <a name="CWL-DeleteMetricFilter-request-logGroupName"></a>
The name of the log group.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[\.\-_/#A-Za-z0-9]+`   
Required: Yes

## Response Elements
<a name="API_DeleteMetricFilter_ResponseElements"></a>

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

## Errors
<a name="API_DeleteMetricFilter_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
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
<a name="API_DeleteMetricFilter_Examples"></a>

### To delete a metric filter
<a name="API_DeleteMetricFilter_Example_1"></a>

The following example deletes the specified filter for the specified log group.

#### Sample Request
<a name="API_DeleteMetricFilter_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.DeleteMetricFilter
{
  "logGroupName": "my-log-group",
  "filterName": "my-metric-filter"
}
```

#### Sample Response
<a name="API_DeleteMetricFilter_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
```

## See Also
<a name="API_DeleteMetricFilter_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DeleteMetricFilter) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DeleteMetricFilter) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DeleteMetricFilter) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DeleteMetricFilter) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DeleteMetricFilter) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DeleteMetricFilter) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DeleteMetricFilter) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DeleteMetricFilter) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DeleteMetricFilter) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DeleteMetricFilter) 

# DeleteQueryDefinition
<a name="API_DeleteQueryDefinition"></a>

Deletes a saved CloudWatch Logs Insights query definition. A query definition contains details about a saved CloudWatch Logs Insights query.

Each `DeleteQueryDefinition` operation can delete one query definition.

You must have the `logs:DeleteQueryDefinition` permission to be able to perform this operation.

## Request Syntax
<a name="API_DeleteQueryDefinition_RequestSyntax"></a>

```
{
   "queryDefinitionId": "string"
}
```

## Request Parameters
<a name="API_DeleteQueryDefinition_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [queryDefinitionId](#API_DeleteQueryDefinition_RequestSyntax) **   <a name="CWL-DeleteQueryDefinition-request-queryDefinitionId"></a>
The ID of the query definition that you want to delete. You can use [DescribeQueryDefinitions](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeQueryDefinitions.html) to retrieve the IDs of your saved query definitions.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 256.  
Required: Yes

## Response Syntax
<a name="API_DeleteQueryDefinition_ResponseSyntax"></a>

```
{
   "success": boolean
}
```

## Response Elements
<a name="API_DeleteQueryDefinition_ResponseElements"></a>

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

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

 ** [success](#API_DeleteQueryDefinition_ResponseSyntax) **   <a name="CWL-DeleteQueryDefinition-response-success"></a>
A value of TRUE indicates that the operation succeeded. FALSE indicates that the operation failed.  
Type: Boolean

## Errors
<a name="API_DeleteQueryDefinition_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** 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
<a name="API_DeleteQueryDefinition_Examples"></a>

### Example
<a name="API_DeleteQueryDefinition_Example_1"></a>

This example deletes a query definition.

#### Sample Request
<a name="API_DeleteQueryDefinition_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.DeleteQueryDefinition
{
   "queryDefinitionId": "123456ab-12ab-123a-789e-1234567890ab"
}
```

#### Sample Response
<a name="API_DeleteQueryDefinition_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
   "success": True
}
```

## See Also
<a name="API_DeleteQueryDefinition_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DeleteQueryDefinition) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DeleteQueryDefinition) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DeleteQueryDefinition) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DeleteQueryDefinition) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DeleteQueryDefinition) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DeleteQueryDefinition) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DeleteQueryDefinition) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DeleteQueryDefinition) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DeleteQueryDefinition) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DeleteQueryDefinition) 

# DeleteResourcePolicy
<a name="API_DeleteResourcePolicy"></a>

Deletes a resource policy from this account. This revokes the access of the identities in that policy to put log events to this account.

## Request Syntax
<a name="API_DeleteResourcePolicy_RequestSyntax"></a>

```
{
   "expectedRevisionId": "string",
   "policyName": "string",
   "resourceArn": "string"
}
```

## Request Parameters
<a name="API_DeleteResourcePolicy_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [expectedRevisionId](#API_DeleteResourcePolicy_RequestSyntax) **   <a name="CWL-DeleteResourcePolicy-request-expectedRevisionId"></a>
The expected revision ID of the resource policy. Required when deleting a resource-scoped policy to prevent concurrent modifications.  
Type: String  
Length Constraints: Minimum length of 1.  
Required: No

 ** [policyName](#API_DeleteResourcePolicy_RequestSyntax) **   <a name="CWL-DeleteResourcePolicy-request-policyName"></a>
The name of the policy to be revoked. This parameter is required.  
Type: String  
Required: No

 ** [resourceArn](#API_DeleteResourcePolicy_RequestSyntax) **   <a name="CWL-DeleteResourcePolicy-request-resourceArn"></a>
The ARN of the CloudWatch Logs resource for which the resource policy needs to be deleted  
Type: String  
Required: No

## Response Elements
<a name="API_DeleteResourcePolicy_ResponseElements"></a>

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

## Errors
<a name="API_DeleteResourcePolicy_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
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

## See Also
<a name="API_DeleteResourcePolicy_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DeleteResourcePolicy) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DeleteResourcePolicy) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DeleteResourcePolicy) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DeleteResourcePolicy) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DeleteResourcePolicy) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DeleteResourcePolicy) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DeleteResourcePolicy) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DeleteResourcePolicy) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DeleteResourcePolicy) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DeleteResourcePolicy) 

# DeleteRetentionPolicy
<a name="API_DeleteRetentionPolicy"></a>

Deletes the specified retention policy.

Log events do not expire if they belong to log groups without a retention policy.

## Request Syntax
<a name="API_DeleteRetentionPolicy_RequestSyntax"></a>

```
{
   "logGroupName": "string"
}
```

## Request Parameters
<a name="API_DeleteRetentionPolicy_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [logGroupName](#API_DeleteRetentionPolicy_RequestSyntax) **   <a name="CWL-DeleteRetentionPolicy-request-logGroupName"></a>
The name of the log group.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[\.\-_/#A-Za-z0-9]+`   
Required: Yes

## Response Elements
<a name="API_DeleteRetentionPolicy_ResponseElements"></a>

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

## Errors
<a name="API_DeleteRetentionPolicy_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
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
<a name="API_DeleteRetentionPolicy_Examples"></a>

### To delete a retention policy
<a name="API_DeleteRetentionPolicy_Example_1"></a>

The following example deletes the retention policy for the specified log group.

#### Sample Request
<a name="API_DeleteRetentionPolicy_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.DeleteRetentionPolicy
{
  "logGroupName": "my-log-group"
}
```

#### Sample Response
<a name="API_DeleteRetentionPolicy_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
```

## See Also
<a name="API_DeleteRetentionPolicy_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DeleteRetentionPolicy) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DeleteRetentionPolicy) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DeleteRetentionPolicy) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DeleteRetentionPolicy) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DeleteRetentionPolicy) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DeleteRetentionPolicy) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DeleteRetentionPolicy) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DeleteRetentionPolicy) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DeleteRetentionPolicy) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DeleteRetentionPolicy) 

# DeleteScheduledQuery
<a name="API_DeleteScheduledQuery"></a>

Deletes a scheduled query and stops all future executions. This operation also removes any configured actions and associated resources.

## Request Syntax
<a name="API_DeleteScheduledQuery_RequestSyntax"></a>

```
{
   "identifier": "string"
}
```

## Request Parameters
<a name="API_DeleteScheduledQuery_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [identifier](#API_DeleteScheduledQuery_RequestSyntax) **   <a name="CWL-DeleteScheduledQuery-request-identifier"></a>
The ARN or name of the scheduled query to delete.  
Type: String  
Pattern: `[\w#+=/:,.@-]*`   
Required: Yes

## Response Elements
<a name="API_DeleteScheduledQuery_ResponseElements"></a>

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

## Errors
<a name="API_DeleteScheduledQuery_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have sufficient permissions to perform this action.  
HTTP Status Code: 400

 ** InternalServerException **   
An internal server error occurred while processing the request. This exception is returned when the service encounters an unexpected condition that prevents it from fulfilling the request.  
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The specified resource does not exist.  
HTTP Status Code: 400

 ** ThrottlingException **   
The request was throttled because of quota limits.  
HTTP Status Code: 400

 ** ValidationException **   
One of the parameters for the request is not valid.  
HTTP Status Code: 400

## See Also
<a name="API_DeleteScheduledQuery_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DeleteScheduledQuery) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DeleteScheduledQuery) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DeleteScheduledQuery) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DeleteScheduledQuery) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DeleteScheduledQuery) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DeleteScheduledQuery) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DeleteScheduledQuery) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DeleteScheduledQuery) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DeleteScheduledQuery) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DeleteScheduledQuery) 

# DeleteSubscriptionFilter
<a name="API_DeleteSubscriptionFilter"></a>

Deletes the specified subscription filter.

## Request Syntax
<a name="API_DeleteSubscriptionFilter_RequestSyntax"></a>

```
{
   "filterName": "string",
   "logGroupName": "string"
}
```

## Request Parameters
<a name="API_DeleteSubscriptionFilter_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [filterName](#API_DeleteSubscriptionFilter_RequestSyntax) **   <a name="CWL-DeleteSubscriptionFilter-request-filterName"></a>
The name of the subscription filter.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[^:*]*`   
Required: Yes

 ** [logGroupName](#API_DeleteSubscriptionFilter_RequestSyntax) **   <a name="CWL-DeleteSubscriptionFilter-request-logGroupName"></a>
The name of the log group.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[\.\-_/#A-Za-z0-9]+`   
Required: Yes

## Response Elements
<a name="API_DeleteSubscriptionFilter_ResponseElements"></a>

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

## Errors
<a name="API_DeleteSubscriptionFilter_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
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
<a name="API_DeleteSubscriptionFilter_Examples"></a>

### To delete a subscription filter
<a name="API_DeleteSubscriptionFilter_Example_1"></a>

The following example deletes the specified subscription filter for the specified log group.

#### Sample Request
<a name="API_DeleteSubscriptionFilter_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.DeleteSubscriptionFilter
{
  "logGroupName": "my-log-group",
  "filterName": "my-subscription-filter"
}
```

#### Sample Response
<a name="API_DeleteSubscriptionFilter_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
```

## See Also
<a name="API_DeleteSubscriptionFilter_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DeleteSubscriptionFilter) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DeleteSubscriptionFilter) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DeleteSubscriptionFilter) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DeleteSubscriptionFilter) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DeleteSubscriptionFilter) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DeleteSubscriptionFilter) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DeleteSubscriptionFilter) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DeleteSubscriptionFilter) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DeleteSubscriptionFilter) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DeleteSubscriptionFilter) 

# DeleteTransformer
<a name="API_DeleteTransformer"></a>

Deletes the log transformer for the specified log group. As soon as you do this, the transformation of incoming log events according to that transformer stops. If this account has an account-level transformer that applies to this log group, the log group begins using that account-level transformer when this log-group level transformer is deleted.

After you delete a transformer, be sure to edit any metric filters or subscription filters that relied on the transformed versions of the log events.

## Request Syntax
<a name="API_DeleteTransformer_RequestSyntax"></a>

```
{
   "logGroupIdentifier": "string"
}
```

## Request Parameters
<a name="API_DeleteTransformer_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [logGroupIdentifier](#API_DeleteTransformer_RequestSyntax) **   <a name="CWL-DeleteTransformer-request-logGroupIdentifier"></a>
Specify either the name or ARN of the log group to delete the transformer for. If the log group is in a source account and you are using a monitoring account, you must use the log group ARN.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Pattern: `[\w#+=/:,.@-]*`   
Required: Yes

## Response Elements
<a name="API_DeleteTransformer_ResponseElements"></a>

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

## Errors
<a name="API_DeleteTransformer_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidOperationException **   
The operation is not valid on the specified resource.  
HTTP Status Code: 400

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
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

## See Also
<a name="API_DeleteTransformer_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DeleteTransformer) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DeleteTransformer) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DeleteTransformer) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DeleteTransformer) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DeleteTransformer) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DeleteTransformer) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DeleteTransformer) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DeleteTransformer) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DeleteTransformer) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DeleteTransformer) 

# DescribeAccountPolicies
<a name="API_DescribeAccountPolicies"></a>

Returns a list of all CloudWatch Logs account policies in the account.

To use this operation, you must be signed on with the correct permissions depending on the type of policy that you are retrieving information for.
+ To see data protection policies, you must have the `logs:GetDataProtectionPolicy` and `logs:DescribeAccountPolicies` permissions.
+ To see subscription filter policies, you must have the `logs:DescribeSubscriptionFilters` and `logs:DescribeAccountPolicies` permissions.
+ To see transformer policies, you must have the `logs:GetTransformer` and `logs:DescribeAccountPolicies` permissions.
+ To see field index policies, you must have the `logs:DescribeIndexPolicies` and `logs:DescribeAccountPolicies` permissions.

## Request Syntax
<a name="API_DescribeAccountPolicies_RequestSyntax"></a>

```
{
   "accountIdentifiers": [ "string" ],
   "nextToken": "string",
   "policyName": "string",
   "policyType": "string"
}
```

## Request Parameters
<a name="API_DescribeAccountPolicies_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [accountIdentifiers](#API_DescribeAccountPolicies_RequestSyntax) **   <a name="CWL-DescribeAccountPolicies-request-accountIdentifiers"></a>
If you are using an account that is set up as a monitoring account for CloudWatch unified cross-account observability, you can use this to specify the account ID of a source account. If you do, the operation returns the account policy for the specified account. Currently, you can specify only one account ID in this parameter.  
If you omit this parameter, only the policy in the current account is returned.  
Type: Array of strings  
Array Members: Minimum number of 0 items. Maximum number of 1 item.  
Length Constraints: Fixed length of 12.  
Pattern: `^\d{12}$`   
Required: No

 ** [nextToken](#API_DescribeAccountPolicies_RequestSyntax) **   <a name="CWL-DescribeAccountPolicies-request-nextToken"></a>
The token for the next set of items to return. (You received this token from a previous call.)  
Type: String  
Length Constraints: Minimum length of 1.  
Required: No

 ** [policyName](#API_DescribeAccountPolicies_RequestSyntax) **   <a name="CWL-DescribeAccountPolicies-request-policyName"></a>
Use this parameter to limit the returned policies to only the policy with the name that you specify.  
Type: String  
Required: No

 ** [policyType](#API_DescribeAccountPolicies_RequestSyntax) **   <a name="CWL-DescribeAccountPolicies-request-policyType"></a>
Use this parameter to limit the returned policies to only the policies that match the policy type that you specify.  
Type: String  
Valid Values: `DATA_PROTECTION_POLICY | SUBSCRIPTION_FILTER_POLICY | FIELD_INDEX_POLICY | TRANSFORMER_POLICY | METRIC_EXTRACTION_POLICY`   
Required: Yes

## Response Syntax
<a name="API_DescribeAccountPolicies_ResponseSyntax"></a>

```
{
   "accountPolicies": [ 
      { 
         "accountId": "string",
         "lastUpdatedTime": number,
         "policyDocument": "string",
         "policyName": "string",
         "policyType": "string",
         "scope": "string",
         "selectionCriteria": "string"
      }
   ],
   "nextToken": "string"
}
```

## Response Elements
<a name="API_DescribeAccountPolicies_ResponseElements"></a>

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

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

 ** [accountPolicies](#API_DescribeAccountPolicies_ResponseSyntax) **   <a name="CWL-DescribeAccountPolicies-response-accountPolicies"></a>
An array of structures that contain information about the CloudWatch Logs account policies that match the specified filters.  
Type: Array of [AccountPolicy](API_AccountPolicy.md) objects

 ** [nextToken](#API_DescribeAccountPolicies_ResponseSyntax) **   <a name="CWL-DescribeAccountPolicies-response-nextToken"></a>
The token to use when requesting the next set of items. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.

## Errors
<a name="API_DescribeAccountPolicies_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
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

## See Also
<a name="API_DescribeAccountPolicies_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DescribeAccountPolicies) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DescribeAccountPolicies) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DescribeAccountPolicies) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DescribeAccountPolicies) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DescribeAccountPolicies) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DescribeAccountPolicies) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DescribeAccountPolicies) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DescribeAccountPolicies) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DescribeAccountPolicies) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DescribeAccountPolicies) 

# DescribeConfigurationTemplates
<a name="API_DescribeConfigurationTemplates"></a>

Use this operation to return the valid and default values that are used when creating delivery sources, delivery destinations, and deliveries. For more information about deliveries, see [CreateDelivery](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateDelivery.html).

## Request Syntax
<a name="API_DescribeConfigurationTemplates_RequestSyntax"></a>

```
{
   "deliveryDestinationTypes": [ "string" ],
   "limit": number,
   "logTypes": [ "string" ],
   "nextToken": "string",
   "resourceTypes": [ "string" ],
   "service": "string"
}
```

## Request Parameters
<a name="API_DescribeConfigurationTemplates_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [deliveryDestinationTypes](#API_DescribeConfigurationTemplates_RequestSyntax) **   <a name="CWL-DescribeConfigurationTemplates-request-deliveryDestinationTypes"></a>
Use this parameter to filter the response to include only the configuration templates that apply to the delivery destination types that you specify here.  
Type: Array of strings  
Array Members: Minimum number of 1 item. Maximum number of 4 items.  
Valid Values: `S3 | CWL | FH | XRAY`   
Required: No

 ** [limit](#API_DescribeConfigurationTemplates_RequestSyntax) **   <a name="CWL-DescribeConfigurationTemplates-request-limit"></a>
Use this parameter to limit the number of configuration templates that are returned in the response.  
Type: Integer  
Valid Range: Minimum value of 1. Maximum value of 50.  
Required: No

 ** [logTypes](#API_DescribeConfigurationTemplates_RequestSyntax) **   <a name="CWL-DescribeConfigurationTemplates-request-logTypes"></a>
Use this parameter to filter the response to include only the configuration templates that apply to the log types that you specify here.  
Type: Array of strings  
Array Members: Minimum number of 1 item. Maximum number of 10 items.  
Length Constraints: Minimum length of 1. Maximum length of 255.  
Pattern: `[\w]*`   
Required: No

 ** [nextToken](#API_DescribeConfigurationTemplates_RequestSyntax) **   <a name="CWL-DescribeConfigurationTemplates-request-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.  
Required: No

 ** [resourceTypes](#API_DescribeConfigurationTemplates_RequestSyntax) **   <a name="CWL-DescribeConfigurationTemplates-request-resourceTypes"></a>
Use this parameter to filter the response to include only the configuration templates that apply to the resource types that you specify here.  
Type: Array of strings  
Array Members: Minimum number of 1 item. Maximum number of 10 items.  
Length Constraints: Minimum length of 1. Maximum length of 255.  
Pattern: `[\w-_]*`   
Required: No

 ** [service](#API_DescribeConfigurationTemplates_RequestSyntax) **   <a name="CWL-DescribeConfigurationTemplates-request-service"></a>
Use this parameter to filter the response to include only the configuration templates that apply to the AWS service that you specify here.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 255.  
Pattern: `[\w_-]*`   
Required: No

## Response Syntax
<a name="API_DescribeConfigurationTemplates_ResponseSyntax"></a>

```
{
   "configurationTemplates": [ 
      { 
         "allowedActionForAllowVendedLogsDeliveryForResource": "string",
         "allowedFieldDelimiters": [ "string" ],
         "allowedFields": [ 
            { 
               "mandatory": boolean,
               "name": "string"
            }
         ],
         "allowedOutputFormats": [ "string" ],
         "allowedSuffixPathFields": [ "string" ],
         "defaultDeliveryConfigValues": { 
            "fieldDelimiter": "string",
            "recordFields": [ "string" ],
            "s3DeliveryConfiguration": { 
               "enableHiveCompatiblePath": boolean,
               "suffixPath": "string"
            }
         },
         "deliveryDestinationType": "string",
         "logType": "string",
         "resourceType": "string",
         "service": "string"
      }
   ],
   "nextToken": "string"
}
```

## Response Elements
<a name="API_DescribeConfigurationTemplates_ResponseElements"></a>

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

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

 ** [configurationTemplates](#API_DescribeConfigurationTemplates_ResponseSyntax) **   <a name="CWL-DescribeConfigurationTemplates-response-configurationTemplates"></a>
An array of objects, where each object describes one configuration template that matches the filters that you specified in the request.  
Type: Array of [ConfigurationTemplate](API_ConfigurationTemplate.md) objects

 ** [nextToken](#API_DescribeConfigurationTemplates_ResponseSyntax) **   <a name="CWL-DescribeConfigurationTemplates-response-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.

## Errors
<a name="API_DescribeConfigurationTemplates_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ResourceNotFoundException **   
The specified resource does not exist.  
HTTP Status Code: 400

 ** ServiceUnavailableException **   
The service cannot complete the request.  
HTTP Status Code: 500

 ** ThrottlingException **   
The request was throttled because of quota limits.  
HTTP Status Code: 400

 ** ValidationException **   
One of the parameters for the request is not valid.  
HTTP Status Code: 400

## See Also
<a name="API_DescribeConfigurationTemplates_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DescribeConfigurationTemplates) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DescribeConfigurationTemplates) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DescribeConfigurationTemplates) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DescribeConfigurationTemplates) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DescribeConfigurationTemplates) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DescribeConfigurationTemplates) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DescribeConfigurationTemplates) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DescribeConfigurationTemplates) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DescribeConfigurationTemplates) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DescribeConfigurationTemplates) 

# DescribeDeliveries
<a name="API_DescribeDeliveries"></a>

Retrieves a list of the deliveries that have been created in the account.

A *delivery* is a connection between a [https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliverySource.html](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliverySource.html) and a [https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliveryDestination.html](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliveryDestination.html).

A delivery source represents an AWS resource that sends logs to an logs delivery destination. The destination can be CloudWatch Logs, Amazon S3, Firehose or X-Ray. Only some AWS services support being configured as a delivery source. These services are listed in [Enable logging from AWS services.](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html) 

## Request Syntax
<a name="API_DescribeDeliveries_RequestSyntax"></a>

```
{
   "limit": number,
   "nextToken": "string"
}
```

## Request Parameters
<a name="API_DescribeDeliveries_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [limit](#API_DescribeDeliveries_RequestSyntax) **   <a name="CWL-DescribeDeliveries-request-limit"></a>
Optionally specify the maximum number of deliveries to return in the response.  
Type: Integer  
Valid Range: Minimum value of 1. Maximum value of 50.  
Required: No

 ** [nextToken](#API_DescribeDeliveries_RequestSyntax) **   <a name="CWL-DescribeDeliveries-request-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.  
Required: No

## Response Syntax
<a name="API_DescribeDeliveries_ResponseSyntax"></a>

```
{
   "deliveries": [ 
      { 
         "arn": "string",
         "deliveryDestinationArn": "string",
         "deliveryDestinationType": "string",
         "deliverySourceName": "string",
         "fieldDelimiter": "string",
         "id": "string",
         "recordFields": [ "string" ],
         "s3DeliveryConfiguration": { 
            "enableHiveCompatiblePath": boolean,
            "suffixPath": "string"
         },
         "tags": { 
            "string" : "string" 
         }
      }
   ],
   "nextToken": "string"
}
```

## Response Elements
<a name="API_DescribeDeliveries_ResponseElements"></a>

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

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

 ** [deliveries](#API_DescribeDeliveries_ResponseSyntax) **   <a name="CWL-DescribeDeliveries-response-deliveries"></a>
An array of structures. Each structure contains information about one delivery in the account.  
Type: Array of [Delivery](API_Delivery.md) objects

 ** [nextToken](#API_DescribeDeliveries_ResponseSyntax) **   <a name="CWL-DescribeDeliveries-response-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.

## Errors
<a name="API_DescribeDeliveries_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ServiceQuotaExceededException **   
This request exceeds a service quota.  
HTTP Status Code: 400

 ** ServiceUnavailableException **   
The service cannot complete the request.  
HTTP Status Code: 500

 ** ThrottlingException **   
The request was throttled because of quota limits.  
HTTP Status Code: 400

 ** ValidationException **   
One of the parameters for the request is not valid.  
HTTP Status Code: 400

## See Also
<a name="API_DescribeDeliveries_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DescribeDeliveries) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DescribeDeliveries) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DescribeDeliveries) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DescribeDeliveries) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DescribeDeliveries) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DescribeDeliveries) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DescribeDeliveries) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DescribeDeliveries) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DescribeDeliveries) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DescribeDeliveries) 

# DescribeDeliveryDestinations
<a name="API_DescribeDeliveryDestinations"></a>

Retrieves a list of the delivery destinations that have been created in the account.

## Request Syntax
<a name="API_DescribeDeliveryDestinations_RequestSyntax"></a>

```
{
   "limit": number,
   "nextToken": "string"
}
```

## Request Parameters
<a name="API_DescribeDeliveryDestinations_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [limit](#API_DescribeDeliveryDestinations_RequestSyntax) **   <a name="CWL-DescribeDeliveryDestinations-request-limit"></a>
Optionally specify the maximum number of delivery destinations to return in the response.  
Type: Integer  
Valid Range: Minimum value of 1. Maximum value of 50.  
Required: No

 ** [nextToken](#API_DescribeDeliveryDestinations_RequestSyntax) **   <a name="CWL-DescribeDeliveryDestinations-request-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.  
Required: No

## Response Syntax
<a name="API_DescribeDeliveryDestinations_ResponseSyntax"></a>

```
{
   "deliveryDestinations": [ 
      { 
         "arn": "string",
         "deliveryDestinationConfiguration": { 
            "destinationResourceArn": "string"
         },
         "deliveryDestinationType": "string",
         "name": "string",
         "outputFormat": "string",
         "tags": { 
            "string" : "string" 
         }
      }
   ],
   "nextToken": "string"
}
```

## Response Elements
<a name="API_DescribeDeliveryDestinations_ResponseElements"></a>

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

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

 ** [deliveryDestinations](#API_DescribeDeliveryDestinations_ResponseSyntax) **   <a name="CWL-DescribeDeliveryDestinations-response-deliveryDestinations"></a>
An array of structures. Each structure contains information about one delivery destination in the account.  
Type: Array of [DeliveryDestination](API_DeliveryDestination.md) objects

 ** [nextToken](#API_DescribeDeliveryDestinations_ResponseSyntax) **   <a name="CWL-DescribeDeliveryDestinations-response-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.

## Errors
<a name="API_DescribeDeliveryDestinations_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ServiceQuotaExceededException **   
This request exceeds a service quota.  
HTTP Status Code: 400

 ** ServiceUnavailableException **   
The service cannot complete the request.  
HTTP Status Code: 500

 ** ThrottlingException **   
The request was throttled because of quota limits.  
HTTP Status Code: 400

 ** ValidationException **   
One of the parameters for the request is not valid.  
HTTP Status Code: 400

## See Also
<a name="API_DescribeDeliveryDestinations_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DescribeDeliveryDestinations) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DescribeDeliveryDestinations) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DescribeDeliveryDestinations) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DescribeDeliveryDestinations) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DescribeDeliveryDestinations) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DescribeDeliveryDestinations) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DescribeDeliveryDestinations) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DescribeDeliveryDestinations) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DescribeDeliveryDestinations) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DescribeDeliveryDestinations) 

# DescribeDeliverySources
<a name="API_DescribeDeliverySources"></a>

Retrieves a list of the delivery sources that have been created in the account.

## Request Syntax
<a name="API_DescribeDeliverySources_RequestSyntax"></a>

```
{
   "limit": number,
   "nextToken": "string"
}
```

## Request Parameters
<a name="API_DescribeDeliverySources_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [limit](#API_DescribeDeliverySources_RequestSyntax) **   <a name="CWL-DescribeDeliverySources-request-limit"></a>
Optionally specify the maximum number of delivery sources to return in the response.  
Type: Integer  
Valid Range: Minimum value of 1. Maximum value of 50.  
Required: No

 ** [nextToken](#API_DescribeDeliverySources_RequestSyntax) **   <a name="CWL-DescribeDeliverySources-request-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.  
Required: No

## Response Syntax
<a name="API_DescribeDeliverySources_ResponseSyntax"></a>

```
{
   "deliverySources": [ 
      { 
         "arn": "string",
         "logType": "string",
         "name": "string",
         "resourceArns": [ "string" ],
         "service": "string",
         "tags": { 
            "string" : "string" 
         }
      }
   ],
   "nextToken": "string"
}
```

## Response Elements
<a name="API_DescribeDeliverySources_ResponseElements"></a>

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

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

 ** [deliverySources](#API_DescribeDeliverySources_ResponseSyntax) **   <a name="CWL-DescribeDeliverySources-response-deliverySources"></a>
An array of structures. Each structure contains information about one delivery source in the account.  
Type: Array of [DeliverySource](API_DeliverySource.md) objects

 ** [nextToken](#API_DescribeDeliverySources_ResponseSyntax) **   <a name="CWL-DescribeDeliverySources-response-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.

## Errors
<a name="API_DescribeDeliverySources_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ServiceQuotaExceededException **   
This request exceeds a service quota.  
HTTP Status Code: 400

 ** ServiceUnavailableException **   
The service cannot complete the request.  
HTTP Status Code: 500

 ** ThrottlingException **   
The request was throttled because of quota limits.  
HTTP Status Code: 400

 ** ValidationException **   
One of the parameters for the request is not valid.  
HTTP Status Code: 400

## See Also
<a name="API_DescribeDeliverySources_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DescribeDeliverySources) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DescribeDeliverySources) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DescribeDeliverySources) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DescribeDeliverySources) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DescribeDeliverySources) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DescribeDeliverySources) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DescribeDeliverySources) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DescribeDeliverySources) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DescribeDeliverySources) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DescribeDeliverySources) 

# DescribeDestinations
<a name="API_DescribeDestinations"></a>

Lists all your destinations. The results are ASCII-sorted by destination name.

## Request Syntax
<a name="API_DescribeDestinations_RequestSyntax"></a>

```
{
   "DestinationNamePrefix": "string",
   "limit": number,
   "nextToken": "string"
}
```

## Request Parameters
<a name="API_DescribeDestinations_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [DestinationNamePrefix](#API_DescribeDestinations_RequestSyntax) **   <a name="CWL-DescribeDestinations-request-DestinationNamePrefix"></a>
The prefix to match. If you don't specify a value, no prefix filter is applied.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[^:*]*`   
Required: No

 ** [limit](#API_DescribeDestinations_RequestSyntax) **   <a name="CWL-DescribeDestinations-request-limit"></a>
The maximum number of items returned. If you don't specify a value, the default maximum value of 50 items is used.  
Type: Integer  
Valid Range: Minimum value of 1. Maximum value of 50.  
Required: No

 ** [nextToken](#API_DescribeDestinations_RequestSyntax) **   <a name="CWL-DescribeDestinations-request-nextToken"></a>
The token for the next set of items to return. (You received this token from a previous call.)  
Type: String  
Length Constraints: Minimum length of 1.  
Required: No

## Response Syntax
<a name="API_DescribeDestinations_ResponseSyntax"></a>

```
{
   "destinations": [ 
      { 
         "accessPolicy": "string",
         "arn": "string",
         "creationTime": number,
         "destinationName": "string",
         "roleArn": "string",
         "targetArn": "string"
      }
   ],
   "nextToken": "string"
}
```

## Response Elements
<a name="API_DescribeDestinations_ResponseElements"></a>

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

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

 ** [destinations](#API_DescribeDestinations_ResponseSyntax) **   <a name="CWL-DescribeDestinations-response-destinations"></a>
The destinations.  
Type: Array of [Destination](API_Destination.md) objects

 ** [nextToken](#API_DescribeDestinations_ResponseSyntax) **   <a name="CWL-DescribeDestinations-response-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.

## Errors
<a name="API_DescribeDestinations_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** ServiceUnavailableException **   
The service cannot complete the request.  
HTTP Status Code: 500

## Examples
<a name="API_DescribeDestinations_Examples"></a>

### To list all destinations
<a name="API_DescribeDestinations_Example_1"></a>

The following example lists all the destinations for the account.

#### Sample Request
<a name="API_DescribeDestinations_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.DescribeDestinations
{
  "destinationNamePrefix": "my-prefix"
}
```

#### Sample Response
<a name="API_DescribeDestinations_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
  "destination": [
    {
      "destinationName": "my-destination",
      "targetArn": "arn:aws:kinesis:us-east-1:123456789012:stream/my-kinesis-stream",
      "roleArn": "arn:aws:iam::123456789012:role/my-subscription-role",
      "arn": "arn:aws:logs:us-east-1:123456789012:destination:my-destination",
      "creationTime": 1437584472382
    }
  ]
}
```

## See Also
<a name="API_DescribeDestinations_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DescribeDestinations) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DescribeDestinations) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DescribeDestinations) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DescribeDestinations) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DescribeDestinations) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DescribeDestinations) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DescribeDestinations) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DescribeDestinations) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DescribeDestinations) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DescribeDestinations) 

# DescribeExportTasks
<a name="API_DescribeExportTasks"></a>

Lists the specified export tasks. You can list all your export tasks or filter the results based on task ID or task status.

## Request Syntax
<a name="API_DescribeExportTasks_RequestSyntax"></a>

```
{
   "limit": number,
   "nextToken": "string",
   "statusCode": "string",
   "taskId": "string"
}
```

## Request Parameters
<a name="API_DescribeExportTasks_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [limit](#API_DescribeExportTasks_RequestSyntax) **   <a name="CWL-DescribeExportTasks-request-limit"></a>
The maximum number of items returned. If you don't specify a value, the default is up to 50 items.  
Type: Integer  
Valid Range: Minimum value of 1. Maximum value of 50.  
Required: No

 ** [nextToken](#API_DescribeExportTasks_RequestSyntax) **   <a name="CWL-DescribeExportTasks-request-nextToken"></a>
The token for the next set of items to return. (You received this token from a previous call.)  
Type: String  
Length Constraints: Minimum length of 1.  
Required: No

 ** [statusCode](#API_DescribeExportTasks_RequestSyntax) **   <a name="CWL-DescribeExportTasks-request-statusCode"></a>
The status code of the export task. Specifying a status code filters the results to zero or more export tasks.  
Type: String  
Valid Values: `CANCELLED | COMPLETED | FAILED | PENDING | PENDING_CANCEL | RUNNING`   
Required: No

 ** [taskId](#API_DescribeExportTasks_RequestSyntax) **   <a name="CWL-DescribeExportTasks-request-taskId"></a>
The ID of the export task. Specifying a task ID filters the results to one or zero export tasks.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Required: No

## Response Syntax
<a name="API_DescribeExportTasks_ResponseSyntax"></a>

```
{
   "exportTasks": [ 
      { 
         "destination": "string",
         "destinationPrefix": "string",
         "executionInfo": { 
            "completionTime": number,
            "creationTime": number
         },
         "from": number,
         "logGroupName": "string",
         "status": { 
            "code": "string",
            "message": "string"
         },
         "taskId": "string",
         "taskName": "string",
         "to": number
      }
   ],
   "nextToken": "string"
}
```

## Response Elements
<a name="API_DescribeExportTasks_ResponseElements"></a>

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

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

 ** [exportTasks](#API_DescribeExportTasks_ResponseSyntax) **   <a name="CWL-DescribeExportTasks-response-exportTasks"></a>
The export tasks.  
Type: Array of [ExportTask](API_ExportTask.md) objects

 ** [nextToken](#API_DescribeExportTasks_ResponseSyntax) **   <a name="CWL-DescribeExportTasks-response-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.

## Errors
<a name="API_DescribeExportTasks_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** ServiceUnavailableException **   
The service cannot complete the request.  
HTTP Status Code: 500

## Examples
<a name="API_DescribeExportTasks_Examples"></a>

### To list the export tasks that are complete
<a name="API_DescribeExportTasks_Example_1"></a>

The following example lists the export tasks with the `COMPLETE` status.

#### Sample Request
<a name="API_DescribeExportTasks_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.DescribeExportTasks
{
  "statusCode": "COMPLETE"
}
```

#### Sample Response
<a name="API_DescribeExportTasks_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
  "exportTasks": [
    {
      "taskId": "exampleTaskId",
      "taskName": "my-task-1",
      "logGroupName": "my-log-group",
      "from": 1437584472382,
      "to": 1437584472833,
      "destination": "my-destination",
      "destinationPrefix": "my-prefix",
      "status":
        {
          "code": "COMPLETE",
          "message": "Example message"
        },
      "executionInfo":
        {
          "creationTime": 1437584472856,
          "completionTime" : 1437584472986
        }
    },
    {
      "taskId": "exampleTaskId",
      "taskName": "my-task-2",
      "logGroupName": "my-log-group",
      "from": 1437584472382,
      "to": 1437584472833,
      "destination": "my-destination",
      "destinationPrefix": "my-prefix",
      "status":
        {
          "code": "COMPLETE",
          "message": "Example message"
        },
      "executionInfo":
        {
          "creationTime": 1437584472856,
          "completionTime" : 1437584472986
        }
    }
  ]
}
```

## See Also
<a name="API_DescribeExportTasks_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DescribeExportTasks) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DescribeExportTasks) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DescribeExportTasks) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DescribeExportTasks) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DescribeExportTasks) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DescribeExportTasks) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DescribeExportTasks) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DescribeExportTasks) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DescribeExportTasks) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DescribeExportTasks) 

# DescribeFieldIndexes
<a name="API_DescribeFieldIndexes"></a>

Returns a list of custom and default field indexes which are discovered in log data. For more information about field index policies, see [PutIndexPolicy](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutIndexPolicy.html).

## Request Syntax
<a name="API_DescribeFieldIndexes_RequestSyntax"></a>

```
{
   "logGroupIdentifiers": [ "string" ],
   "nextToken": "string"
}
```

## Request Parameters
<a name="API_DescribeFieldIndexes_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [logGroupIdentifiers](#API_DescribeFieldIndexes_RequestSyntax) **   <a name="CWL-DescribeFieldIndexes-request-logGroupIdentifiers"></a>
An array containing the names or ARNs of the log groups that you want to retrieve field indexes for.  
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 2048.  
Pattern: `[\w#+=/:,.@-]*`   
Required: Yes

 ** [nextToken](#API_DescribeFieldIndexes_RequestSyntax) **   <a name="CWL-DescribeFieldIndexes-request-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.  
Required: No

## Response Syntax
<a name="API_DescribeFieldIndexes_ResponseSyntax"></a>

```
{
   "fieldIndexes": [ 
      { 
         "fieldIndexName": "string",
         "firstEventTime": number,
         "lastEventTime": number,
         "lastScanTime": number,
         "logGroupIdentifier": "string",
         "type": "string"
      }
   ],
   "nextToken": "string"
}
```

## Response Elements
<a name="API_DescribeFieldIndexes_ResponseElements"></a>

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

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

 ** [fieldIndexes](#API_DescribeFieldIndexes_ResponseSyntax) **   <a name="CWL-DescribeFieldIndexes-response-fieldIndexes"></a>
An array containing the field index information.  
Type: Array of [FieldIndex](API_FieldIndex.md) objects

 ** [nextToken](#API_DescribeFieldIndexes_ResponseSyntax) **   <a name="CWL-DescribeFieldIndexes-response-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.

## Errors
<a name="API_DescribeFieldIndexes_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** LimitExceededException **   
You have reached the maximum number of resources that can be created.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
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

## See Also
<a name="API_DescribeFieldIndexes_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DescribeFieldIndexes) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DescribeFieldIndexes) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DescribeFieldIndexes) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DescribeFieldIndexes) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DescribeFieldIndexes) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DescribeFieldIndexes) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DescribeFieldIndexes) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DescribeFieldIndexes) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DescribeFieldIndexes) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DescribeFieldIndexes) 

# DescribeImportTaskBatches
<a name="API_DescribeImportTaskBatches"></a>

Gets detailed information about the individual batches within an import task, including their status and any error messages. For CloudTrail Event Data Store sources, a batch refers to a subset of stored events grouped by their eventTime. 

## Request Syntax
<a name="API_DescribeImportTaskBatches_RequestSyntax"></a>

```
{
   "batchImportStatus": [ "string" ],
   "importId": "string",
   "limit": number,
   "nextToken": "string"
}
```

## Request Parameters
<a name="API_DescribeImportTaskBatches_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [batchImportStatus](#API_DescribeImportTaskBatches_RequestSyntax) **   <a name="CWL-DescribeImportTaskBatches-request-batchImportStatus"></a>
Optional filter to list import batches by their status. Accepts multiple status values: IN\$1PROGRESS, CANCELLED, COMPLETED and FAILED.  
Type: Array of strings  
Valid Values: `IN_PROGRESS | CANCELLED | COMPLETED | FAILED`   
Required: No

 ** [importId](#API_DescribeImportTaskBatches_RequestSyntax) **   <a name="CWL-DescribeImportTaskBatches-request-importId"></a>
The ID of the import task to get batch information for.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 256.  
Pattern: `[\-a-zA-Z0-9]+`   
Required: Yes

 ** [limit](#API_DescribeImportTaskBatches_RequestSyntax) **   <a name="CWL-DescribeImportTaskBatches-request-limit"></a>
The maximum number of import batches to return in the response. Default: 10  
Type: Integer  
Valid Range: Minimum value of 1. Maximum value of 50.  
Required: No

 ** [nextToken](#API_DescribeImportTaskBatches_RequestSyntax) **   <a name="CWL-DescribeImportTaskBatches-request-nextToken"></a>
The pagination token for the next set of results.  
Type: String  
Length Constraints: Minimum length of 1.  
Required: No

## Response Syntax
<a name="API_DescribeImportTaskBatches_ResponseSyntax"></a>

```
{
   "importBatches": [ 
      { 
         "batchId": "string",
         "errorMessage": "string",
         "status": "string"
      }
   ],
   "importId": "string",
   "importSourceArn": "string",
   "nextToken": "string"
}
```

## Response Elements
<a name="API_DescribeImportTaskBatches_ResponseElements"></a>

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

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

 ** [importBatches](#API_DescribeImportTaskBatches_ResponseSyntax) **   <a name="CWL-DescribeImportTaskBatches-response-importBatches"></a>
The list of import batches that match the request filters.  
Type: Array of [ImportBatch](API_ImportBatch.md) objects

 ** [importId](#API_DescribeImportTaskBatches_ResponseSyntax) **   <a name="CWL-DescribeImportTaskBatches-response-importId"></a>
The ID of the import task.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 256.  
Pattern: `[\-a-zA-Z0-9]+` 

 ** [importSourceArn](#API_DescribeImportTaskBatches_ResponseSyntax) **   <a name="CWL-DescribeImportTaskBatches-response-importSourceArn"></a>
The ARN of the source being imported from.  
Type: String

 ** [nextToken](#API_DescribeImportTaskBatches_ResponseSyntax) **   <a name="CWL-DescribeImportTaskBatches-response-nextToken"></a>
The token to use when requesting the next set of results. Not present if there are no additional results to retrieve.  
Type: String  
Length Constraints: Minimum length of 1.

## Errors
<a name="API_DescribeImportTaskBatches_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have sufficient permissions to perform this action.  
HTTP Status Code: 400

 ** InvalidOperationException **   
The operation is not valid on the specified resource.  
HTTP Status Code: 400

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
The specified resource does not exist.  
HTTP Status Code: 400

 ** ThrottlingException **   
The request was throttled because of quota limits.  
HTTP Status Code: 400

## Examples
<a name="API_DescribeImportTaskBatches_Examples"></a>

### To describe import task batches
<a name="API_DescribeImportTaskBatches_Example_1"></a>

The following example retrieves batch-level details for an import task with status filtering.

#### Sample Request
<a name="API_DescribeImportTaskBatches_Example_1_Request"></a>

```
POST / HTTP/1.1
          Host: logs.<region>.<domain>
          X-Amz-Target: Logs_20140328.DescribeImportTaskBatches
          {
          "importId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
          "batchImportStatus": ["IN_PROGRESS", "COMPLETED"],
          "limit": 25,
          "nextToken": "eyJOZXh0VG9rZW4iOiJudWxsIiwiYm90b190cnVuY2F0ZV9hbW91bnQiOjF9"
          }
```

#### Sample Response
<a name="API_DescribeImportTaskBatches_Example_1_Response"></a>

```
HTTP/1.1 200 OK
          {
          "importSourceArn": "arn:aws:cloudtrail:us-west-2:123456789012:eventdatastore/f1d45bff-d0e3-4868-b5d9-2eb678aa32fb",
          "importId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
          "importBatches": [
          {
          "batchId": "b1c2d3e4-f5g6-7890-hijk-lm1234567890",
          "status": "COMPLETED"
          },
          {
          "batchId": "c2d3e4f5-g6h7-8901-ijkl-mn2345678901",
          "status": "IN_PROGRESS"
          },
          {
          "batchId": "d3e4f5g6-h7i8-9012-jklm-no3456789012",
          "status": "FAILED",
          "errorMessage": "Access denied to CloudTrail event data store"
          }
          ],
          "nextToken": "eyJOZXh0VG9rZW4iOiJudWxsIiwiYm90b190cnVuY2F0ZV9hbW91bnQiOjJ9"
          }
```

## See Also
<a name="API_DescribeImportTaskBatches_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DescribeImportTaskBatches) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DescribeImportTaskBatches) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DescribeImportTaskBatches) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DescribeImportTaskBatches) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DescribeImportTaskBatches) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DescribeImportTaskBatches) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DescribeImportTaskBatches) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DescribeImportTaskBatches) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DescribeImportTaskBatches) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DescribeImportTaskBatches) 

# DescribeImportTasks
<a name="API_DescribeImportTasks"></a>

Lists and describes import tasks, with optional filtering by import status and source ARN.

## Request Syntax
<a name="API_DescribeImportTasks_RequestSyntax"></a>

```
{
   "importId": "string",
   "importSourceArn": "string",
   "importStatus": "string",
   "limit": number,
   "nextToken": "string"
}
```

## Request Parameters
<a name="API_DescribeImportTasks_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [importId](#API_DescribeImportTasks_RequestSyntax) **   <a name="CWL-DescribeImportTasks-request-importId"></a>
Optional filter to describe a specific import task by its ID.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 256.  
Pattern: `[\-a-zA-Z0-9]+`   
Required: No

 ** [importSourceArn](#API_DescribeImportTasks_RequestSyntax) **   <a name="CWL-DescribeImportTasks-request-importSourceArn"></a>
Optional filter to list imports from a specific source  
Type: String  
Required: No

 ** [importStatus](#API_DescribeImportTasks_RequestSyntax) **   <a name="CWL-DescribeImportTasks-request-importStatus"></a>
Optional filter to list imports by their status. Valid values are IN\$1PROGRESS, CANCELLED, COMPLETED and FAILED.  
Type: String  
Valid Values: `IN_PROGRESS | CANCELLED | COMPLETED | FAILED`   
Required: No

 ** [limit](#API_DescribeImportTasks_RequestSyntax) **   <a name="CWL-DescribeImportTasks-request-limit"></a>
The maximum number of import tasks to return in the response. Default: 50  
Type: Integer  
Valid Range: Minimum value of 1. Maximum value of 50.  
Required: No

 ** [nextToken](#API_DescribeImportTasks_RequestSyntax) **   <a name="CWL-DescribeImportTasks-request-nextToken"></a>
The pagination token for the next set of results.  
Type: String  
Length Constraints: Minimum length of 1.  
Required: No

## Response Syntax
<a name="API_DescribeImportTasks_ResponseSyntax"></a>

```
{
   "imports": [ 
      { 
         "creationTime": number,
         "errorMessage": "string",
         "importDestinationArn": "string",
         "importFilter": { 
            "endEventTime": number,
            "startEventTime": number
         },
         "importId": "string",
         "importSourceArn": "string",
         "importStatistics": { 
            "bytesImported": number
         },
         "importStatus": "string",
         "lastUpdatedTime": number
      }
   ],
   "nextToken": "string"
}
```

## Response Elements
<a name="API_DescribeImportTasks_ResponseElements"></a>

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

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

 ** [imports](#API_DescribeImportTasks_ResponseSyntax) **   <a name="CWL-DescribeImportTasks-response-imports"></a>
The list of import tasks that match the request filters.  
Type: Array of [Import](API_Import.md) objects

 ** [nextToken](#API_DescribeImportTasks_ResponseSyntax) **   <a name="CWL-DescribeImportTasks-response-nextToken"></a>
The token to use when requesting the next set of results. Not present if there are no additional results to retrieve.  
Type: String  
Length Constraints: Minimum length of 1.

## Errors
<a name="API_DescribeImportTasks_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have sufficient permissions to perform this action.  
HTTP Status Code: 400

 ** InvalidOperationException **   
The operation is not valid on the specified resource.  
HTTP Status Code: 400

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
The specified resource does not exist.  
HTTP Status Code: 400

 ** ThrottlingException **   
The request was throttled because of quota limits.  
HTTP Status Code: 400

## Examples
<a name="API_DescribeImportTasks_Examples"></a>

### To describe import tasks
<a name="API_DescribeImportTasks_Example_1"></a>

The following example retrieves a list of import tasks with filters.

#### Sample Request
<a name="API_DescribeImportTasks_Example_1_Request"></a>

```
POST / HTTP/1.1
          Host: logs.<region>.<domain>
          X-Amz-Target: Logs_20140328.DescribeImportTasks
          {
          "importId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
          "importStatus": "IN_PROGRESS",
          "importSourceArn": "arn:aws:cloudtrail:us-west-2:123456789012:eventdatastore/f1d45bff-d0e3-4868-b5d9-2eb678aa32fb",
          "limit": 50,
          "nextToken": "eyJOZXh0VG9rZW4iOiJudWxsIiwiYm90b190cnVuY2F0ZV9hbW91bnQiOjF9"
          }
```

#### Sample Response
<a name="API_DescribeImportTasks_Example_1_Response"></a>

```
HTTP/1.1 200 OK
          {
          "imports": [
          {
          "importId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
          "importSourceArn": "arn:aws:cloudtrail:us-east-1:123456789012:eventdatastore/f1d45bff-d0e3-4868-b5d9-2eb678aa32fb",
          "importStatus": "IN_PROGRESS",
          "importDestinationArn": "arn:aws:logs:us-east-1:123456789012:log-group:aws/cloudtrail/f1d45bff-d0e3-4868-b5d9-2eb678aa32fb",
          "importStatistics": {
          "bytesImported": 1048576
          },
          "importFilter": {
          "startEventTime": 1640995200000,
          "endEventTime": 1641081600000
          },
          "creationTime": 1641168000000,
          "lastUpdatedTime": 1641171600000
          }
          ],
          "nextToken": "eyJOZXh0VG9rZW4iOiJudWxsIiwiYm90b190cnVuY2F0ZV9hbW91bnQiOjJ9"
          }
```

## See Also
<a name="API_DescribeImportTasks_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DescribeImportTasks) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DescribeImportTasks) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DescribeImportTasks) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DescribeImportTasks) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DescribeImportTasks) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DescribeImportTasks) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DescribeImportTasks) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DescribeImportTasks) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DescribeImportTasks) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DescribeImportTasks) 

# DescribeIndexPolicies
<a name="API_DescribeIndexPolicies"></a>

Returns the field index policies of the specified log group. For more information about field index policies, see [PutIndexPolicy](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutIndexPolicy.html).

If a specified log group has a log-group level index policy, that policy is returned by this operation.

If a specified log group doesn't have a log-group level index policy, but an account-wide index policy applies to it, that account-wide policy is returned by this operation.

To find information about only account-level policies, use [DescribeAccountPolicies](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeAccountPolicies.html) instead.

## Request Syntax
<a name="API_DescribeIndexPolicies_RequestSyntax"></a>

```
{
   "logGroupIdentifiers": [ "string" ],
   "nextToken": "string"
}
```

## Request Parameters
<a name="API_DescribeIndexPolicies_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [logGroupIdentifiers](#API_DescribeIndexPolicies_RequestSyntax) **   <a name="CWL-DescribeIndexPolicies-request-logGroupIdentifiers"></a>
An array containing the name or ARN of the log group that you want to retrieve field index policies for.  
Type: Array of strings  
Array Members: Fixed number of 1 item.  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Pattern: `[\w#+=/:,.@-]*`   
Required: Yes

 ** [nextToken](#API_DescribeIndexPolicies_RequestSyntax) **   <a name="CWL-DescribeIndexPolicies-request-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.  
Required: No

## Response Syntax
<a name="API_DescribeIndexPolicies_ResponseSyntax"></a>

```
{
   "indexPolicies": [ 
      { 
         "lastUpdateTime": number,
         "logGroupIdentifier": "string",
         "policyDocument": "string",
         "policyName": "string",
         "source": "string"
      }
   ],
   "nextToken": "string"
}
```

## Response Elements
<a name="API_DescribeIndexPolicies_ResponseElements"></a>

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

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

 ** [indexPolicies](#API_DescribeIndexPolicies_ResponseSyntax) **   <a name="CWL-DescribeIndexPolicies-response-indexPolicies"></a>
An array containing the field index policies.  
Type: Array of [IndexPolicy](API_IndexPolicy.md) objects

 ** [nextToken](#API_DescribeIndexPolicies_ResponseSyntax) **   <a name="CWL-DescribeIndexPolicies-response-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.

## Errors
<a name="API_DescribeIndexPolicies_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** LimitExceededException **   
You have reached the maximum number of resources that can be created.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
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

## See Also
<a name="API_DescribeIndexPolicies_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DescribeIndexPolicies) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DescribeIndexPolicies) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DescribeIndexPolicies) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DescribeIndexPolicies) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DescribeIndexPolicies) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DescribeIndexPolicies) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DescribeIndexPolicies) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DescribeIndexPolicies) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DescribeIndexPolicies) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DescribeIndexPolicies) 

# DescribeLogGroups
<a name="API_DescribeLogGroups"></a>

Returns information about log groups, including data sources that ingest into each log group. You can return all your log groups or filter the results by prefix. The results are ASCII-sorted by log group name.

CloudWatch Logs doesn't support IAM policies that control access to the `DescribeLogGroups` action by using the `aws:ResourceTag/key-name ` condition key. Other CloudWatch Logs actions do support the use of the `aws:ResourceTag/key-name ` condition key to control access. For more information about using tags to control access, see [Controlling access to Amazon Web Services resources using tags](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_tags.html).

If you are using CloudWatch cross-account observability, you can use this operation in a monitoring account and view data from the linked source accounts. For more information, see [CloudWatch cross-account observability](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html).

## Request Syntax
<a name="API_DescribeLogGroups_RequestSyntax"></a>

```
{
   "accountIdentifiers": [ "string" ],
   "includeLinkedAccounts": boolean,
   "limit": number,
   "logGroupClass": "string",
   "logGroupIdentifiers": [ "string" ],
   "logGroupNamePattern": "string",
   "logGroupNamePrefix": "string",
   "nextToken": "string"
}
```

## Request Parameters
<a name="API_DescribeLogGroups_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [accountIdentifiers](#API_DescribeLogGroups_RequestSyntax) **   <a name="CWL-DescribeLogGroups-request-accountIdentifiers"></a>
When `includeLinkedAccounts` is set to `true`, use this parameter to specify the list of accounts to search. You can specify as many as 20 account IDs in the array.   
Type: Array of strings  
Array Members: Minimum number of 0 items. Maximum number of 20 items.  
Length Constraints: Fixed length of 12.  
Pattern: `^\d{12}$`   
Required: No

 ** [includeLinkedAccounts](#API_DescribeLogGroups_RequestSyntax) **   <a name="CWL-DescribeLogGroups-request-includeLinkedAccounts"></a>
If you are using a monitoring account, set this to `true` to have the operation return log groups in the accounts listed in `accountIdentifiers`.  
If this parameter is set to `true` and `accountIdentifiers` contains a null value, the operation returns all log groups in the monitoring account and all log groups in all source accounts that are linked to the monitoring account.   
The default for this parameter is `false`.  
Type: Boolean  
Required: No

 ** [limit](#API_DescribeLogGroups_RequestSyntax) **   <a name="CWL-DescribeLogGroups-request-limit"></a>
The maximum number of items returned. If you don't specify a value, the default is up to 50 items.  
Type: Integer  
Valid Range: Minimum value of 1. Maximum value of 50.  
Required: No

 ** [logGroupClass](#API_DescribeLogGroups_RequestSyntax) **   <a name="CWL-DescribeLogGroups-request-logGroupClass"></a>
Use this parameter to limit the results to only those log groups in the specified log group class. If you omit this parameter, log groups of all classes can be returned.  
Specifies the log group class for this log group. There are three classes:  
+ The `Standard` log class supports all CloudWatch Logs features.
+ The `Infrequent Access` log class supports a subset of CloudWatch Logs features and incurs lower costs.
+ Use the `Delivery` log class only for delivering AWS Lambda logs to store in Amazon S3 or Amazon Data Firehose. Log events in log groups in the Delivery class are kept in CloudWatch Logs for only one day. This log class doesn't offer rich CloudWatch Logs capabilities such as CloudWatch Logs Insights queries.
For details about the features supported by each class, see [Log classes](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch_Logs_Log_Classes.html)   
Type: String  
Valid Values: `STANDARD | INFREQUENT_ACCESS | DELIVERY`   
Required: No

 ** [logGroupIdentifiers](#API_DescribeLogGroups_RequestSyntax) **   <a name="CWL-DescribeLogGroups-request-logGroupIdentifiers"></a>
Use this array to filter the list of log groups returned. If you specify this parameter, the only other filter that you can choose to specify is `includeLinkedAccounts`.  
If you are using this operation in a monitoring account, you can specify the ARNs of log groups in source accounts and in the monitoring account itself. If you are using this operation in an account that is not a cross-account monitoring account, you can specify only log group names in the same account as the operation.  
Type: Array of strings  
Array Members: Minimum number of 1 item. Maximum number of 50 items.  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Pattern: `[\w#+=/:,.@-]*`   
Required: No

 ** [logGroupNamePattern](#API_DescribeLogGroups_RequestSyntax) **   <a name="CWL-DescribeLogGroups-request-logGroupNamePattern"></a>
If you specify a string for this parameter, the operation returns only log groups that have names that match the string based on a case-sensitive substring search. For example, if you specify `DataLogs`, log groups named `DataLogs`, `aws/DataLogs`, and `GroupDataLogs` would match, but `datalogs`, `Data/log/s` and `Groupdata` would not match.  
If you specify `logGroupNamePattern` in your request, then only `arn`, `creationTime`, and `logGroupName` are included in the response.   
 `logGroupNamePattern` and `logGroupNamePrefix` are mutually exclusive. Only one of these parameters can be passed. 
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 512.  
Pattern: `[\.\-_/#A-Za-z0-9]*`   
Required: No

 ** [logGroupNamePrefix](#API_DescribeLogGroups_RequestSyntax) **   <a name="CWL-DescribeLogGroups-request-logGroupNamePrefix"></a>
The prefix to match.  
 `logGroupNamePrefix` and `logGroupNamePattern` are mutually exclusive. Only one of these parameters can be passed. 
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[\.\-_/#A-Za-z0-9]+`   
Required: No

 ** [nextToken](#API_DescribeLogGroups_RequestSyntax) **   <a name="CWL-DescribeLogGroups-request-nextToken"></a>
The token for the next set of items to return. (You received this token from a previous call.)  
Type: String  
Length Constraints: Minimum length of 1.  
Required: No

## Response Syntax
<a name="API_DescribeLogGroups_ResponseSyntax"></a>

```
{
   "logGroups": [ 
      { 
         "arn": "string",
         "bearerTokenAuthenticationEnabled": boolean,
         "creationTime": number,
         "dataProtectionStatus": "string",
         "deletionProtectionEnabled": boolean,
         "inheritedProperties": [ "string" ],
         "kmsKeyId": "string",
         "logGroupArn": "string",
         "logGroupClass": "string",
         "logGroupName": "string",
         "metricFilterCount": number,
         "retentionInDays": number,
         "storedBytes": number
      }
   ],
   "nextToken": "string"
}
```

## Response Elements
<a name="API_DescribeLogGroups_ResponseElements"></a>

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

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

 ** [logGroups](#API_DescribeLogGroups_ResponseSyntax) **   <a name="CWL-DescribeLogGroups-response-logGroups"></a>
An array of structures, where each structure contains the information about one log group.  
Type: Array of [LogGroup](API_LogGroup.md) objects

 ** [nextToken](#API_DescribeLogGroups_ResponseSyntax) **   <a name="CWL-DescribeLogGroups-response-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.

## Errors
<a name="API_DescribeLogGroups_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** ServiceUnavailableException **   
The service cannot complete the request.  
HTTP Status Code: 500

## Examples
<a name="API_DescribeLogGroups_Examples"></a>

### To list all log groups
<a name="API_DescribeLogGroups_Example_1"></a>

The following example lists all your log groups.

#### Sample Request
<a name="API_DescribeLogGroups_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.DescribeLogGroups
```

#### Sample Response
<a name="API_DescribeLogGroups_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
  "logGroups": [
    {
      "storageBytes": 1048576,
      "arn": "arn:aws:logs:us-east-1:123456789012:log-group:my-log-group-1:*",
      "creationTime": 1393545600000,
      "logGroupName": "my-log-group-1",
      "metricFilterCount": 0,
      "retentionInDays": 14,
      "kmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/abcd1234-a123-456a-a12b-a123b4cd56ef",
      "deletionProtectionEnabled": true
      "bearerTokenAuthenticationEnabled": true
    },
    {
      "storageBytes": 5242880,
      "arn": "arn:aws:logs:us-east-1:123456789012:log-group:my-log-group-2:*",
      "creationTime": 1396224000000,
      "logGroupName": "my-log-group-2",
      "metricFilterCount": 0,
      "retentionInDays": 30,
      "deletionProtectionEnabled": false
      "bearerTokenAuthenticationEnabled": false
    }
  ]
}
```

### To list all of the log groups in a monitoring account and all linked source accounts that have logGroup in their name
<a name="API_DescribeLogGroups_Example_2"></a>

The following example lists all of the log groups in a monitoring account and all linked source accounts that have `logGroup` in their name.

#### Sample Request
<a name="API_DescribeLogGroups_Example_2_Request"></a>

```
{
  "includeLinkedAccounts" : "true",
  "logGroupNamePattern": "logGroup"
}
```

#### Sample Response
<a name="API_DescribeLogGroups_Example_2_Response"></a>

```
{
  "logGroups": [
    {
      "arn": "arn:aws:logs:us-east-1:123456789012:log-group:monitoring-logGroup-1234:*",
      "creationTime": 1393545600000,
      "logGroupName": "monitoring-logGroup-1234"
    },
    {
      "arn": "arn:aws:logs:us-east-1:012345678901:log-group:source-loggroup-5678:*",
      "creationTime": 1396224000000,
      "logGroupName": "source-loggroup-5678"
      }
  ]
}
```

## See Also
<a name="API_DescribeLogGroups_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DescribeLogGroups) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DescribeLogGroups) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DescribeLogGroups) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DescribeLogGroups) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DescribeLogGroups) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DescribeLogGroups) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DescribeLogGroups) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DescribeLogGroups) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DescribeLogGroups) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DescribeLogGroups) 

# DescribeLogStreams
<a name="API_DescribeLogStreams"></a>

Lists the log streams for the specified log group. You can list all the log streams or filter the results by prefix. You can also control how the results are ordered.

You can specify the log group to search by using either `logGroupIdentifier` or `logGroupName`. You must include one of these two parameters, but you can't include both. 

This operation has a limit of 25 transactions per second, after which transactions are throttled.

If you are using CloudWatch cross-account observability, you can use this operation in a monitoring account and view data from the linked source accounts. For more information, see [CloudWatch cross-account observability](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html).

## Request Syntax
<a name="API_DescribeLogStreams_RequestSyntax"></a>

```
{
   "descending": boolean,
   "limit": number,
   "logGroupIdentifier": "string",
   "logGroupName": "string",
   "logStreamNamePrefix": "string",
   "nextToken": "string",
   "orderBy": "string"
}
```

## Request Parameters
<a name="API_DescribeLogStreams_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [descending](#API_DescribeLogStreams_RequestSyntax) **   <a name="CWL-DescribeLogStreams-request-descending"></a>
If the value is true, results are returned in descending order. If the value is to false, results are returned in ascending order. The default value is false.  
Type: Boolean  
Required: No

 ** [limit](#API_DescribeLogStreams_RequestSyntax) **   <a name="CWL-DescribeLogStreams-request-limit"></a>
The maximum number of items returned. If you don't specify a value, the default is up to 50 items.  
Type: Integer  
Valid Range: Minimum value of 1. Maximum value of 50.  
Required: No

 ** [logGroupIdentifier](#API_DescribeLogStreams_RequestSyntax) **   <a name="CWL-DescribeLogStreams-request-logGroupIdentifier"></a>
Specify either the name or ARN of the log group to view. If the log group is in a source account and you are using a monitoring account, you must use the log group ARN.  
 You must include either `logGroupIdentifier` or `logGroupName`, but not both. 
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Pattern: `[\w#+=/:,.@-]*`   
Required: No

 ** [logGroupName](#API_DescribeLogStreams_RequestSyntax) **   <a name="CWL-DescribeLogStreams-request-logGroupName"></a>
The name of the log group.  
 You must include either `logGroupIdentifier` or `logGroupName`, but not both. 
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[\.\-_/#A-Za-z0-9]+`   
Required: No

 ** [logStreamNamePrefix](#API_DescribeLogStreams_RequestSyntax) **   <a name="CWL-DescribeLogStreams-request-logStreamNamePrefix"></a>
The prefix to match.  
If `orderBy` is `LastEventTime`, you cannot specify this parameter.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[^:*]*`   
Required: No

 ** [nextToken](#API_DescribeLogStreams_RequestSyntax) **   <a name="CWL-DescribeLogStreams-request-nextToken"></a>
The token for the next set of items to return. (You received this token from a previous call.)  
Type: String  
Length Constraints: Minimum length of 1.  
Required: No

 ** [orderBy](#API_DescribeLogStreams_RequestSyntax) **   <a name="CWL-DescribeLogStreams-request-orderBy"></a>
If the value is `LogStreamName`, the results are ordered by log stream name. If the value is `LastEventTime`, the results are ordered by the event time. The default value is `LogStreamName`.  
If you order the results by event time, you cannot specify the `logStreamNamePrefix` parameter.  
 `lastEventTimestamp` represents the time of the most recent log event in the log stream in CloudWatch Logs. This number is expressed as the number of milliseconds after `Jan 1, 1970 00:00:00 UTC`. `lastEventTimestamp` updates on an eventual consistency basis. It typically updates in less than an hour from ingestion, but in rare situations might take longer.  
Type: String  
Valid Values: `LogStreamName | LastEventTime`   
Required: No

## Response Syntax
<a name="API_DescribeLogStreams_ResponseSyntax"></a>

```
{
   "logStreams": [ 
      { 
         "arn": "string",
         "creationTime": number,
         "firstEventTimestamp": number,
         "lastEventTimestamp": number,
         "lastIngestionTime": number,
         "logStreamName": "string",
         "storedBytes": number,
         "uploadSequenceToken": "string"
      }
   ],
   "nextToken": "string"
}
```

## Response Elements
<a name="API_DescribeLogStreams_ResponseElements"></a>

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

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

 ** [logStreams](#API_DescribeLogStreams_ResponseSyntax) **   <a name="CWL-DescribeLogStreams-response-logStreams"></a>
The log streams.  
Type: Array of [LogStream](API_LogStream.md) objects

 ** [nextToken](#API_DescribeLogStreams_ResponseSyntax) **   <a name="CWL-DescribeLogStreams-response-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.

## Errors
<a name="API_DescribeLogStreams_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** 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
<a name="API_DescribeLogStreams_Examples"></a>

### To list the log streams for a log group
<a name="API_DescribeLogStreams_Example_1"></a>

The following example lists the log streams associated with the specified log group.

#### Sample Request
<a name="API_DescribeLogStreams_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.DescribeLogStreams
{
  "logGroupName": "my-log-group"
}
```

#### Sample Response
<a name="API_DescribeLogStreams_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
  "logStreams": [
    {
      "storedBytes": 0,
      "arn": "arn:aws:logs:us-east-1:123456789012:log-group:my-log-group-1:log-stream:my-log-stream-1",
      "creationTime": 1393545600000,
      "firstEventTimestamp": 1393545600000,
      "lastEventTimestamp": 1393567800000,
      "lastIngestionTime": 1393589200000,
      "logStreamName": "my-log-stream-1"
    },
    {
      "storedBytes": 0,
      "arn": "arn:aws:logs:us-east-1:123456789012:log-group:my-log-group-2:log-stream:my-log-stream-2",
      "creationTime": 1396224000000,
      "firstEventTimestamp": 1396224000000,
      "lastEventTimestamp": 1396235500000,
      "lastIngestionTime": 1396225560000,
      "logStreamName": "my-log-stream-2"
    }
  ]
}
```

### Example
<a name="API_DescribeLogStreams_Example_2"></a>

The following example lists the log streams associated with the specified log group.

#### Sample Request
<a name="API_DescribeLogStreams_Example_2_Request"></a>

```
{
  "logGroupIdentifier": "arn:aws:logs:us-east-1:123456789012:log-group:my-log-group-1:dli"
}
```

#### Sample Response
<a name="API_DescribeLogStreams_Example_2_Response"></a>

```
{
  "logStreams": [
    {
      "storedBytes": 0,
      "arn": "arn:aws:logs:us-east-1:123456789012:log-group:my-log-group-1:log-stream:my-
log-stream-1",
      "creationTime": 1393545600000,
      "firstEventTimestamp": 1393545600000,
      "lastEventTimestamp": 1393567800000,
      "lastIngestionTime": 1393589200000,
      "logStreamName": "my-log-stream-1"
      },
      {
      "storedBytes": 0,
      "arn": "arn:aws:logs:us-east-1:123456789012:log-group:my-log-group-2:log-stream:my-
log-stream-2",
      "creationTime": 1396224000000,
      "firstEventTimestamp": 1396224000000,
      "lastEventTimestamp": 1396235500000,
      "lastIngestionTime": 1396225560000,
      "logStreamName": "my-log-stream-2"
      } ]
}
```

## See Also
<a name="API_DescribeLogStreams_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DescribeLogStreams) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DescribeLogStreams) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DescribeLogStreams) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DescribeLogStreams) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DescribeLogStreams) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DescribeLogStreams) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DescribeLogStreams) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DescribeLogStreams) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DescribeLogStreams) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DescribeLogStreams) 

# DescribeLookupTables
<a name="API_DescribeLookupTables"></a>

Retrieves metadata about lookup tables in your account. You can optionally filter the results by table name prefix. Results are sorted by table name in ascending order.

## Request Syntax
<a name="API_DescribeLookupTables_RequestSyntax"></a>

```
{
   "lookupTableNamePrefix": "string",
   "maxResults": number,
   "nextToken": "string"
}
```

## Request Parameters
<a name="API_DescribeLookupTables_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [lookupTableNamePrefix](#API_DescribeLookupTables_RequestSyntax) **   <a name="CWL-DescribeLookupTables-request-lookupTableNamePrefix"></a>
A prefix to filter lookup tables by name. Only tables whose names start with this prefix are returned. If you don't specify a prefix, all tables in the account and Region are returned.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 256.  
Pattern: `^[a-zA-Z0-9_]+$`   
Required: No

 ** [maxResults](#API_DescribeLookupTables_RequestSyntax) **   <a name="CWL-DescribeLookupTables-request-maxResults"></a>
The maximum number of lookup tables to return in the response. The default value is 50 and the maximum value is 100.  
Type: Integer  
Valid Range: Maximum value of 100.  
Required: No

 ** [nextToken](#API_DescribeLookupTables_RequestSyntax) **   <a name="CWL-DescribeLookupTables-request-nextToken"></a>
The token for the next set of items to return. (You received this token from a previous call.)  
Type: String  
Length Constraints: Minimum length of 1.  
Required: No

## Response Syntax
<a name="API_DescribeLookupTables_ResponseSyntax"></a>

```
{
   "lookupTables": [ 
      { 
         "description": "string",
         "kmsKeyId": "string",
         "lastUpdatedTime": number,
         "lookupTableArn": "string",
         "lookupTableName": "string",
         "recordsCount": number,
         "sizeBytes": number,
         "tableFields": [ "string" ]
      }
   ],
   "nextToken": "string"
}
```

## Response Elements
<a name="API_DescribeLookupTables_ResponseElements"></a>

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

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

 ** [lookupTables](#API_DescribeLookupTables_ResponseSyntax) **   <a name="CWL-DescribeLookupTables-response-lookupTables"></a>
An array of structures, where each structure contains metadata about one lookup table.  
Type: Array of [LookupTable](API_LookupTable.md) objects

 ** [nextToken](#API_DescribeLookupTables_ResponseSyntax) **   <a name="CWL-DescribeLookupTables-response-nextToken"></a>
The token to use when requesting the next set of items.  
Type: String  
Length Constraints: Minimum length of 1.

## Errors
<a name="API_DescribeLookupTables_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have sufficient permissions to perform this action.  
HTTP Status Code: 400

 ** 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

## See Also
<a name="API_DescribeLookupTables_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DescribeLookupTables) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DescribeLookupTables) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DescribeLookupTables) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DescribeLookupTables) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DescribeLookupTables) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DescribeLookupTables) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DescribeLookupTables) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DescribeLookupTables) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DescribeLookupTables) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DescribeLookupTables) 

# DescribeMetricFilters
<a name="API_DescribeMetricFilters"></a>

Lists the specified metric filters. You can list all of the metric filters or filter the results by log name, prefix, metric name, or metric namespace. The results are ASCII-sorted by filter name.

## Request Syntax
<a name="API_DescribeMetricFilters_RequestSyntax"></a>

```
{
   "filterNamePrefix": "string",
   "limit": number,
   "logGroupName": "string",
   "metricName": "string",
   "metricNamespace": "string",
   "nextToken": "string"
}
```

## Request Parameters
<a name="API_DescribeMetricFilters_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [filterNamePrefix](#API_DescribeMetricFilters_RequestSyntax) **   <a name="CWL-DescribeMetricFilters-request-filterNamePrefix"></a>
The prefix to match. CloudWatch Logs uses the value that you set here only if you also include the `logGroupName` parameter in your request.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[^:*]*`   
Required: No

 ** [limit](#API_DescribeMetricFilters_RequestSyntax) **   <a name="CWL-DescribeMetricFilters-request-limit"></a>
The maximum number of items returned. If you don't specify a value, the default is up to 50 items.  
Type: Integer  
Valid Range: Minimum value of 1. Maximum value of 50.  
Required: No

 ** [logGroupName](#API_DescribeMetricFilters_RequestSyntax) **   <a name="CWL-DescribeMetricFilters-request-logGroupName"></a>
The name of the log group.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[\.\-_/#A-Za-z0-9]+`   
Required: No

 ** [metricName](#API_DescribeMetricFilters_RequestSyntax) **   <a name="CWL-DescribeMetricFilters-request-metricName"></a>
Filters results to include only those with the specified metric name. If you include this parameter in your request, you must also include the `metricNamespace` parameter.  
Type: String  
Length Constraints: Maximum length of 255.  
Pattern: `[^:*$]*`   
Required: No

 ** [metricNamespace](#API_DescribeMetricFilters_RequestSyntax) **   <a name="CWL-DescribeMetricFilters-request-metricNamespace"></a>
Filters results to include only those in the specified namespace. If you include this parameter in your request, you must also include the `metricName` parameter.  
Type: String  
Length Constraints: Maximum length of 255.  
Pattern: `[^:*$]*`   
Required: No

 ** [nextToken](#API_DescribeMetricFilters_RequestSyntax) **   <a name="CWL-DescribeMetricFilters-request-nextToken"></a>
The token for the next set of items to return. (You received this token from a previous call.)  
Type: String  
Length Constraints: Minimum length of 1.  
Required: No

## Response Syntax
<a name="API_DescribeMetricFilters_ResponseSyntax"></a>

```
{
   "metricFilters": [ 
      { 
         "applyOnTransformedLogs": boolean,
         "creationTime": number,
         "emitSystemFieldDimensions": [ "string" ],
         "fieldSelectionCriteria": "string",
         "filterName": "string",
         "filterPattern": "string",
         "logGroupName": "string",
         "metricTransformations": [ 
            { 
               "defaultValue": number,
               "dimensions": { 
                  "string" : "string" 
               },
               "metricName": "string",
               "metricNamespace": "string",
               "metricValue": "string",
               "unit": "string"
            }
         ]
      }
   ],
   "nextToken": "string"
}
```

## Response Elements
<a name="API_DescribeMetricFilters_ResponseElements"></a>

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

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

 ** [metricFilters](#API_DescribeMetricFilters_ResponseSyntax) **   <a name="CWL-DescribeMetricFilters-response-metricFilters"></a>
The metric filters.  
Type: Array of [MetricFilter](API_MetricFilter.md) objects

 ** [nextToken](#API_DescribeMetricFilters_ResponseSyntax) **   <a name="CWL-DescribeMetricFilters-response-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.

## Errors
<a name="API_DescribeMetricFilters_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** 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
<a name="API_DescribeMetricFilters_Examples"></a>

### To list the metric filters for a log group
<a name="API_DescribeMetricFilters_Example_1"></a>

The following example lists the metric filters for the specified log group.

#### Sample Request
<a name="API_DescribeMetricFilters_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.DescribeMetricFilters
{
  "logGroupName": "my-log-group"
}
```

#### Sample Response
<a name="API_DescribeMetricFilters_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
  "metricFilters": [
    {
      "applyOnTransformedLogs": true,
      "creationTime": 1396224000000,
      "filterName": "my-metric-filter",
      "filterPattern": "[ip, identity, user_id, timestamp, request, status_code, size]",
      "logGroupName": "my-log-group",
      "metricTransformations": [
        {
          "defaultValue": "0",
          "metricValue": "$size",
          "metricNamespace": "my-app",
          "metricName": "Volume"
         }
      ]
    }
  ]
}
```

## See Also
<a name="API_DescribeMetricFilters_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DescribeMetricFilters) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DescribeMetricFilters) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DescribeMetricFilters) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DescribeMetricFilters) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DescribeMetricFilters) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DescribeMetricFilters) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DescribeMetricFilters) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DescribeMetricFilters) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DescribeMetricFilters) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DescribeMetricFilters) 

# DescribeQueries
<a name="API_DescribeQueries"></a>

Returns a list of CloudWatch Logs Insights queries that are scheduled, running, or have been run recently in this account. You can request all queries or limit it to queries of a specific log group or queries with a certain status.

This operation includes both interactive queries started directly by users and automated queries executed by scheduled query configurations. Scheduled query executions appear in the results alongside manually initiated queries, providing visibility into all query activity in your account.

## Request Syntax
<a name="API_DescribeQueries_RequestSyntax"></a>

```
{
   "logGroupName": "string",
   "maxResults": number,
   "nextToken": "string",
   "queryLanguage": "string",
   "status": "string"
}
```

## Request Parameters
<a name="API_DescribeQueries_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [logGroupName](#API_DescribeQueries_RequestSyntax) **   <a name="CWL-DescribeQueries-request-logGroupName"></a>
Limits the returned queries to only those for the specified log group.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[\.\-_/#A-Za-z0-9]+`   
Required: No

 ** [maxResults](#API_DescribeQueries_RequestSyntax) **   <a name="CWL-DescribeQueries-request-maxResults"></a>
Limits the number of returned queries to the specified number.  
Type: Integer  
Valid Range: Minimum value of 1. Maximum value of 1000.  
Required: No

 ** [nextToken](#API_DescribeQueries_RequestSyntax) **   <a name="CWL-DescribeQueries-request-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.  
Required: No

 ** [queryLanguage](#API_DescribeQueries_RequestSyntax) **   <a name="CWL-DescribeQueries-request-queryLanguage"></a>
Limits the returned queries to only the queries that use the specified query language.  
Type: String  
Valid Values: `CWLI | SQL | PPL`   
Required: No

 ** [status](#API_DescribeQueries_RequestSyntax) **   <a name="CWL-DescribeQueries-request-status"></a>
Limits the returned queries to only those that have the specified status. Valid values are `Cancelled`, `Complete`, `Failed`, `Running`, and `Scheduled`.  
Type: String  
Valid Values: `Scheduled | Running | Complete | Failed | Cancelled | Timeout | Unknown`   
Required: No

## Response Syntax
<a name="API_DescribeQueries_ResponseSyntax"></a>

```
{
   "nextToken": "string",
   "queries": [ 
      { 
         "bytesScanned": number,
         "createTime": number,
         "logGroupName": "string",
         "queryDuration": number,
         "queryId": "string",
         "queryLanguage": "string",
         "queryString": "string",
         "status": "string",
         "userIdentity": "string"
      }
   ]
}
```

## Response Elements
<a name="API_DescribeQueries_ResponseElements"></a>

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

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

 ** [nextToken](#API_DescribeQueries_ResponseSyntax) **   <a name="CWL-DescribeQueries-response-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.

 ** [queries](#API_DescribeQueries_ResponseSyntax) **   <a name="CWL-DescribeQueries-response-queries"></a>
The list of queries that match the request.  
Type: Array of [QueryInfo](API_QueryInfo.md) objects

## Errors
<a name="API_DescribeQueries_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** 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
<a name="API_DescribeQueries_Examples"></a>

### List the CloudWatch Logs Insights queries for a specific log group
<a name="API_DescribeQueries_Example_1"></a>

The following example lists the successfully completed queries of the log group named `MyLogGroup`.

#### Sample Request
<a name="API_DescribeQueries_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.DescribeQueries
{
   "logGroupName": "MyLogGroup",
   "status": "Completed"
}
```

#### Sample Response
<a name="API_DescribeQueries_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
    "nextToken": "string",
    "queries": [
        {
            "createTime": 1540923785,
            "logGroupName": "MyLogGroup",
            "queryId": "12ab3456-12ab-123a-789e-1234567890ab",
            "queryString": "filter @message like /Exception/ | stats count(*) as @exceptionCount by date_floor(@timestamp, 5m) | sort @exceptionCount desc",
            "status": "Completed",
            "queryDuration": 5200,
            "bytesScanned": 1048576.0,
            "userIdentity": "arn:aws:iam::123456789012:user/example-user"
        },
        {
            "createTime": 1540025601,
            "logGroupName": "MyLogGroup",
            "queryId": "98ab3456-12ab-123a-789e-1234567890ab",
            "queryString": "stats count(*) by eventSource, eventName, awsRegion",
            "status": "Running",
            "queryDuration": 1500,
            "bytesScanned": 524288.0,
            "userIdentity": "arn:aws:iam::123456789012:user/example-user"
        }
    ]
}
```

## See Also
<a name="API_DescribeQueries_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DescribeQueries) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DescribeQueries) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DescribeQueries) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DescribeQueries) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DescribeQueries) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DescribeQueries) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DescribeQueries) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DescribeQueries) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DescribeQueries) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DescribeQueries) 

# DescribeQueryDefinitions
<a name="API_DescribeQueryDefinitions"></a>

This operation returns a paginated list of your saved CloudWatch Logs Insights query definitions. You can retrieve query definitions from the current account or from a source account that is linked to the current account.

You can use the `queryDefinitionNamePrefix` parameter to limit the results to only the query definitions that have names that start with a certain string.

## Request Syntax
<a name="API_DescribeQueryDefinitions_RequestSyntax"></a>

```
{
   "maxResults": number,
   "nextToken": "string",
   "queryDefinitionNamePrefix": "string",
   "queryLanguage": "string"
}
```

## Request Parameters
<a name="API_DescribeQueryDefinitions_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [maxResults](#API_DescribeQueryDefinitions_RequestSyntax) **   <a name="CWL-DescribeQueryDefinitions-request-maxResults"></a>
Limits the number of returned query definitions to the specified number.  
Type: Integer  
Valid Range: Minimum value of 1. Maximum value of 1000.  
Required: No

 ** [nextToken](#API_DescribeQueryDefinitions_RequestSyntax) **   <a name="CWL-DescribeQueryDefinitions-request-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.  
Required: No

 ** [queryDefinitionNamePrefix](#API_DescribeQueryDefinitions_RequestSyntax) **   <a name="CWL-DescribeQueryDefinitions-request-queryDefinitionNamePrefix"></a>
Use this parameter to filter your results to only the query definitions that have names that start with the prefix you specify.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 255.  
Required: No

 ** [queryLanguage](#API_DescribeQueryDefinitions_RequestSyntax) **   <a name="CWL-DescribeQueryDefinitions-request-queryLanguage"></a>
The query language used for this query. For more information about the query languages that CloudWatch Logs supports, see [Supported query languages](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_AnalyzeLogData_Languages.html).  
Type: String  
Valid Values: `CWLI | SQL | PPL`   
Required: No

## Response Syntax
<a name="API_DescribeQueryDefinitions_ResponseSyntax"></a>

```
{
   "nextToken": "string",
   "queryDefinitions": [ 
      { 
         "lastModified": number,
         "logGroupNames": [ "string" ],
         "name": "string",
         "parameters": [ 
            { 
               "defaultValue": "string",
               "description": "string",
               "name": "string"
            }
         ],
         "queryDefinitionId": "string",
         "queryLanguage": "string",
         "queryString": "string"
      }
   ]
}
```

## Response Elements
<a name="API_DescribeQueryDefinitions_ResponseElements"></a>

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

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

 ** [nextToken](#API_DescribeQueryDefinitions_ResponseSyntax) **   <a name="CWL-DescribeQueryDefinitions-response-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.

 ** [queryDefinitions](#API_DescribeQueryDefinitions_ResponseSyntax) **   <a name="CWL-DescribeQueryDefinitions-response-queryDefinitions"></a>
The list of query definitions that match your request.  
Type: Array of [QueryDefinition](API_QueryDefinition.md) objects

## Errors
<a name="API_DescribeQueryDefinitions_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** ServiceUnavailableException **   
The service cannot complete the request.  
HTTP Status Code: 500

## Examples
<a name="API_DescribeQueryDefinitions_Examples"></a>

### Example
<a name="API_DescribeQueryDefinitions_Example_1"></a>

This example retrieves a list of query definitions that have names that begin with `lambda`.

#### Sample Request
<a name="API_DescribeQueryDefinitions_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.DescribeQueryDefinitions
{
   "queryDefinitionNamePrefix": "lambda",
   "maxResults": 2
}
```

#### Sample Response
<a name="API_DescribeQueryDefinitions_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
   "nextToken": "abdcefghijlkmn",
   "queryDefinitions": [
      {
         "lastModified": 1549321515,
         "logGroupNames": [ "VPC_Flow_Log1", "VPC_Flow_Log2" ],
         "name": "VPC-top15-packet-transfers",
         "queryDefinitionId": "123456ab-12ab-123a-789e-1234567890ab",
         "queryString": "stats sum(packets) as packetsTransferred by srcAddr, dstAddr | sort packetsTransferred  desc | limit 15",
         "parameters": []
      },
      {
         "lastModified": 1557321299,
         "name": "ErrorsByLevel",
         "queryDefinitionId": "456789ab-abcd-1234-789e-0987654321ab",
         "queryString": "fields @timestamp, @message | filter level = {{logLevel}}",
         "parameters": [
            {
               "name": "logLevel",
               "defaultValue": "ERROR",
               "description": "Log level to filter (ERROR, WARN, INFO, DEBUG)"
            }
         ]
      }
   ]
}
```

## See Also
<a name="API_DescribeQueryDefinitions_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DescribeQueryDefinitions) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DescribeQueryDefinitions) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DescribeQueryDefinitions) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DescribeQueryDefinitions) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DescribeQueryDefinitions) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DescribeQueryDefinitions) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DescribeQueryDefinitions) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DescribeQueryDefinitions) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DescribeQueryDefinitions) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DescribeQueryDefinitions) 

# DescribeResourcePolicies
<a name="API_DescribeResourcePolicies"></a>

Lists the resource policies in this account.

## Request Syntax
<a name="API_DescribeResourcePolicies_RequestSyntax"></a>

```
{
   "limit": number,
   "nextToken": "string",
   "policyScope": "string",
   "resourceArn": "string"
}
```

## Request Parameters
<a name="API_DescribeResourcePolicies_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [limit](#API_DescribeResourcePolicies_RequestSyntax) **   <a name="CWL-DescribeResourcePolicies-request-limit"></a>
The maximum number of resource policies to be displayed with one call of this API.  
Type: Integer  
Valid Range: Minimum value of 1. Maximum value of 50.  
Required: No

 ** [nextToken](#API_DescribeResourcePolicies_RequestSyntax) **   <a name="CWL-DescribeResourcePolicies-request-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.  
Required: No

 ** [policyScope](#API_DescribeResourcePolicies_RequestSyntax) **   <a name="CWL-DescribeResourcePolicies-request-policyScope"></a>
Specifies the scope of the resource policy. Valid values are `ACCOUNT` or `RESOURCE`. When not specified, defaults to `ACCOUNT`.  
Type: String  
Valid Values: `ACCOUNT | RESOURCE`   
Required: No

 ** [resourceArn](#API_DescribeResourcePolicies_RequestSyntax) **   <a name="CWL-DescribeResourcePolicies-request-resourceArn"></a>
The ARN of the CloudWatch Logs resource for which to query the resource policy.  
Type: String  
Required: No

## Response Syntax
<a name="API_DescribeResourcePolicies_ResponseSyntax"></a>

```
{
   "nextToken": "string",
   "resourcePolicies": [ 
      { 
         "lastUpdatedTime": number,
         "policyDocument": "string",
         "policyName": "string",
         "policyScope": "string",
         "resourceArn": "string",
         "revisionId": "string"
      }
   ]
}
```

## Response Elements
<a name="API_DescribeResourcePolicies_ResponseElements"></a>

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

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

 ** [nextToken](#API_DescribeResourcePolicies_ResponseSyntax) **   <a name="CWL-DescribeResourcePolicies-response-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.

 ** [resourcePolicies](#API_DescribeResourcePolicies_ResponseSyntax) **   <a name="CWL-DescribeResourcePolicies-response-resourcePolicies"></a>
The resource policies that exist in this account.  
Type: Array of [ResourcePolicy](API_ResourcePolicy.md) objects

## Errors
<a name="API_DescribeResourcePolicies_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** ServiceUnavailableException **   
The service cannot complete the request.  
HTTP Status Code: 500

## See Also
<a name="API_DescribeResourcePolicies_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DescribeResourcePolicies) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DescribeResourcePolicies) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DescribeResourcePolicies) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DescribeResourcePolicies) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DescribeResourcePolicies) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DescribeResourcePolicies) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DescribeResourcePolicies) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DescribeResourcePolicies) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DescribeResourcePolicies) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DescribeResourcePolicies) 

# DescribeSubscriptionFilters
<a name="API_DescribeSubscriptionFilters"></a>

Lists the subscription filters for the specified log group. You can list all the subscription filters or filter the results by prefix. The results are ASCII-sorted by filter name.

## Request Syntax
<a name="API_DescribeSubscriptionFilters_RequestSyntax"></a>

```
{
   "filterNamePrefix": "string",
   "limit": number,
   "logGroupName": "string",
   "nextToken": "string"
}
```

## Request Parameters
<a name="API_DescribeSubscriptionFilters_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [filterNamePrefix](#API_DescribeSubscriptionFilters_RequestSyntax) **   <a name="CWL-DescribeSubscriptionFilters-request-filterNamePrefix"></a>
The prefix to match. If you don't specify a value, no prefix filter is applied.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[^:*]*`   
Required: No

 ** [limit](#API_DescribeSubscriptionFilters_RequestSyntax) **   <a name="CWL-DescribeSubscriptionFilters-request-limit"></a>
The maximum number of items returned. If you don't specify a value, the default is up to 50 items.  
Type: Integer  
Valid Range: Minimum value of 1. Maximum value of 50.  
Required: No

 ** [logGroupName](#API_DescribeSubscriptionFilters_RequestSyntax) **   <a name="CWL-DescribeSubscriptionFilters-request-logGroupName"></a>
The name of the log group.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[\.\-_/#A-Za-z0-9]+`   
Required: Yes

 ** [nextToken](#API_DescribeSubscriptionFilters_RequestSyntax) **   <a name="CWL-DescribeSubscriptionFilters-request-nextToken"></a>
The token for the next set of items to return. (You received this token from a previous call.)  
Type: String  
Length Constraints: Minimum length of 1.  
Required: No

## Response Syntax
<a name="API_DescribeSubscriptionFilters_ResponseSyntax"></a>

```
{
   "nextToken": "string",
   "subscriptionFilters": [ 
      { 
         "applyOnTransformedLogs": boolean,
         "creationTime": number,
         "destinationArn": "string",
         "distribution": "string",
         "emitSystemFields": [ "string" ],
         "fieldSelectionCriteria": "string",
         "filterName": "string",
         "filterPattern": "string",
         "logGroupName": "string",
         "roleArn": "string"
      }
   ]
}
```

## Response Elements
<a name="API_DescribeSubscriptionFilters_ResponseElements"></a>

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

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

 ** [nextToken](#API_DescribeSubscriptionFilters_ResponseSyntax) **   <a name="CWL-DescribeSubscriptionFilters-response-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.

 ** [subscriptionFilters](#API_DescribeSubscriptionFilters_ResponseSyntax) **   <a name="CWL-DescribeSubscriptionFilters-response-subscriptionFilters"></a>
The subscription filters.  
Type: Array of [SubscriptionFilter](API_SubscriptionFilter.md) objects

## Errors
<a name="API_DescribeSubscriptionFilters_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** 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
<a name="API_DescribeSubscriptionFilters_Examples"></a>

### To list the subscription filters for a log group
<a name="API_DescribeSubscriptionFilters_Example_1"></a>

The following example lists the subscription filters for the specified log group.

#### Sample Request
<a name="API_DescribeSubscriptionFilters_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.DescribeSubscriptionFilters
{
  "logGroupName": "my-log-group"
}
```

#### Sample Response
<a name="API_DescribeSubscriptionFilters_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
  "subscriptionFilters": [
    {
      "creationTime": 1396224000000,
      "logGroupName": "my-log-group",
      "filterName": "my-subscription-ilter",
      "filterPattern": "[ip, identity, user_id, timestamp, request, status_code = 500, size]",
      "destinationArn": "arn:aws:kinesis:us-east-1:123456789012:stream/my-kinesis-stream",
      "roleArn": "arn:aws:iam::123456789012:role/my-subscription-role"
    }
  ]
}
```

## See Also
<a name="API_DescribeSubscriptionFilters_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DescribeSubscriptionFilters) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DescribeSubscriptionFilters) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DescribeSubscriptionFilters) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DescribeSubscriptionFilters) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DescribeSubscriptionFilters) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DescribeSubscriptionFilters) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DescribeSubscriptionFilters) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DescribeSubscriptionFilters) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DescribeSubscriptionFilters) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DescribeSubscriptionFilters) 

# DisassociateKmsKey
<a name="API_DisassociateKmsKey"></a>

Disassociates the specified AWS KMS key from the specified log group or from all CloudWatch Logs Insights query results in the account.

When you use `DisassociateKmsKey`, you specify either the `logGroupName` parameter or the `resourceIdentifier` parameter. You can't specify both of those parameters in the same operation.
+ Specify the `logGroupName` parameter to stop using the AWS KMS key to encrypt future log events ingested and stored in the log group. Instead, they will be encrypted with the default CloudWatch Logs method. The log events that were ingested while the key was associated with the log group are still encrypted with that key. Therefore, CloudWatch Logs will need permissions for the key whenever that data is accessed.
+ Specify the `resourceIdentifier` parameter with the `query-result` resource to stop using the AWS KMS key to encrypt the results of all future [StartQuery](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_StartQuery.html) operations in the account. They will instead be encrypted with the default CloudWatch Logs method. The results from queries that ran while the key was associated with the account are still encrypted with that key. Therefore, CloudWatch Logs will need permissions for the key whenever that data is accessed.

It can take up to 5 minutes for this operation to take effect.

## Request Syntax
<a name="API_DisassociateKmsKey_RequestSyntax"></a>

```
{
   "logGroupName": "string",
   "resourceIdentifier": "string"
}
```

## Request Parameters
<a name="API_DisassociateKmsKey_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [logGroupName](#API_DisassociateKmsKey_RequestSyntax) **   <a name="CWL-DisassociateKmsKey-request-logGroupName"></a>
The name of the log group.  
In your `DisassociateKmsKey` operation, you must specify either the `resourceIdentifier` parameter or the `logGroup` parameter, but you can't specify both.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[\.\-_/#A-Za-z0-9]+`   
Required: No

 ** [resourceIdentifier](#API_DisassociateKmsKey_RequestSyntax) **   <a name="CWL-DisassociateKmsKey-request-resourceIdentifier"></a>
Specifies the target for this operation. You must specify one of the following:  
+ Specify the ARN of a log group to stop having CloudWatch Logs use the AWS KMS key to encrypt log events that are ingested and stored by that log group. After you run this operation, CloudWatch Logs encrypts ingested log events with the default CloudWatch Logs method. The log group ARN must be in the following format. Replace *REGION* and *ACCOUNT\$1ID* with your Region and account ID.

   `arn:aws:logs:REGION:ACCOUNT_ID:log-group:LOG_GROUP_NAME ` 
+ Specify the following ARN to stop using this key to encrypt the results of future [StartQuery](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_StartQuery.html) operations in this account. Replace *REGION* and *ACCOUNT\$1ID* with your Region and account ID.

   `arn:aws:logs:REGION:ACCOUNT_ID:query-result:*` 
In your `DisssociateKmsKey` operation, you must specify either the `resourceIdentifier` parameter or the `logGroup` parameter, but you can't specify both.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Pattern: `[\w+=/:,.@\-\*]*`   
Required: No

## Response Elements
<a name="API_DisassociateKmsKey_ResponseElements"></a>

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

## Errors
<a name="API_DisassociateKmsKey_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
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
<a name="API_DisassociateKmsKey_Examples"></a>

### To disassociate an KMS key from a log group
<a name="API_DisassociateKmsKey_Example_1"></a>

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

#### Sample Request
<a name="API_DisassociateKmsKey_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.DisassociateKmsKey
{
  "logGroupName": "my-log-group",
}
```

#### Sample Response
<a name="API_DisassociateKmsKey_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
```

## See Also
<a name="API_DisassociateKmsKey_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DisassociateKmsKey) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DisassociateKmsKey) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DisassociateKmsKey) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DisassociateKmsKey) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DisassociateKmsKey) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DisassociateKmsKey) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DisassociateKmsKey) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DisassociateKmsKey) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DisassociateKmsKey) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DisassociateKmsKey) 

# DisassociateSourceFromS3TableIntegration
<a name="API_DisassociateSourceFromS3TableIntegration"></a>

Disassociates a data source from an S3 Table Integration, removing query access and deleting all associated data from the integration.

## Request Syntax
<a name="API_DisassociateSourceFromS3TableIntegration_RequestSyntax"></a>

```
{
   "identifier": "string"
}
```

## Request Parameters
<a name="API_DisassociateSourceFromS3TableIntegration_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [identifier](#API_DisassociateSourceFromS3TableIntegration_RequestSyntax) **   <a name="CWL-DisassociateSourceFromS3TableIntegration-request-identifier"></a>
The unique identifier of the association to remove between the data source and S3 Table Integration.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Required: Yes

## Response Syntax
<a name="API_DisassociateSourceFromS3TableIntegration_ResponseSyntax"></a>

```
{
   "identifier": "string"
}
```

## Response Elements
<a name="API_DisassociateSourceFromS3TableIntegration_ResponseElements"></a>

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

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

 ** [identifier](#API_DisassociateSourceFromS3TableIntegration_ResponseSyntax) **   <a name="CWL-DisassociateSourceFromS3TableIntegration-response-identifier"></a>
The unique identifier of the association that was removed.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.

## Errors
<a name="API_DisassociateSourceFromS3TableIntegration_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have sufficient permissions to perform this action.  
HTTP Status Code: 400

 ** InternalServerException **   
An internal server error occurred while processing the request. This exception is returned when the service encounters an unexpected condition that prevents it from fulfilling the request.  
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The specified resource does not exist.  
HTTP Status Code: 400

 ** ThrottlingException **   
The request was throttled because of quota limits.  
HTTP Status Code: 400

 ** ValidationException **   
One of the parameters for the request is not valid.  
HTTP Status Code: 400

## See Also
<a name="API_DisassociateSourceFromS3TableIntegration_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/DisassociateSourceFromS3TableIntegration) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/DisassociateSourceFromS3TableIntegration) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/DisassociateSourceFromS3TableIntegration) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/DisassociateSourceFromS3TableIntegration) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/DisassociateSourceFromS3TableIntegration) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/DisassociateSourceFromS3TableIntegration) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/DisassociateSourceFromS3TableIntegration) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/DisassociateSourceFromS3TableIntegration) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/DisassociateSourceFromS3TableIntegration) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/DisassociateSourceFromS3TableIntegration) 

# FilterLogEvents
<a name="API_FilterLogEvents"></a>

Lists log events from the specified log group. You can list all the log events or filter the results using one or more of the following:
+ A filter pattern
+ A time range
+ The log stream name, or a log stream name prefix that matches multiple log streams

You must have the `logs:FilterLogEvents` permission to perform this operation.

You can specify the log group to search by using either `logGroupIdentifier` or `logGroupName`. You must include one of these two parameters, but you can't include both. 

 `FilterLogEvents` is a paginated operation. Each page returned can contain up to 1 MB of log events or up to 10,000 log events. A returned page might only be partially full, or even empty. For example, if the result of a query would return 15,000 log events, the first page isn't guaranteed to have 10,000 log events even if they all fit into 1 MB.

Partially full or empty pages don't necessarily mean that pagination is finished. If the results include a `nextToken`, there might be more log events available. You can return these additional log events by providing the nextToken in a subsequent `FilterLogEvents` operation. If the results don't include a `nextToken`, then pagination is finished. 

Specifying the `limit` parameter only guarantees that a single page doesn't return more log events than the specified limit, but it might return fewer events than the limit. This is the expected API behavior.

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.

If you are using CloudWatch cross-account observability, you can use this operation in a monitoring account and view data from the linked source accounts. For more information, see [CloudWatch cross-account observability](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html).

**Note**  
If you are using [log transformation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html), the `FilterLogEvents` operation returns only the original versions of log events, before they were transformed. To view the transformed versions, you must use a [CloudWatch Logs query.](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AnalyzingLogData.html) 

## Request Syntax
<a name="API_FilterLogEvents_RequestSyntax"></a>

```
{
   "endTime": number,
   "filterPattern": "string",
   "interleaved": boolean,
   "limit": number,
   "logGroupIdentifier": "string",
   "logGroupName": "string",
   "logStreamNamePrefix": "string",
   "logStreamNames": [ "string" ],
   "nextToken": "string",
   "startTime": number,
   "unmask": boolean
}
```

## Request Parameters
<a name="API_FilterLogEvents_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [endTime](#API_FilterLogEvents_RequestSyntax) **   <a name="CWL-FilterLogEvents-request-endTime"></a>
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](#API_FilterLogEvents_RequestSyntax) **   <a name="CWL-FilterLogEvents-request-filterPattern"></a>
The filter pattern to use. For more information, see [Filter and Pattern Syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html).  
If not provided, all the events are matched.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Required: No

 ** [interleaved](#API_FilterLogEvents_RequestSyntax) **   <a name="CWL-FilterLogEvents-request-interleaved"></a>
 *This parameter has been deprecated.*   
If the value is true, the operation attempts 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.  
 **Important** As of 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](#API_FilterLogEvents_RequestSyntax) **   <a name="CWL-FilterLogEvents-request-limit"></a>
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

 ** [logGroupIdentifier](#API_FilterLogEvents_RequestSyntax) **   <a name="CWL-FilterLogEvents-request-logGroupIdentifier"></a>
Specify either the name or ARN of the log group to view log events from. If the log group is in a source account and you are using a monitoring account, you must use the log group ARN.  
 You must include either `logGroupIdentifier` or `logGroupName`, but not both. 
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Pattern: `[\w#+=/:,.@-]*`   
Required: No

 ** [logGroupName](#API_FilterLogEvents_RequestSyntax) **   <a name="CWL-FilterLogEvents-request-logGroupName"></a>
The name of the log group to search.  
 You must include either `logGroupIdentifier` or `logGroupName`, but not both. 
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[\.\-_/#A-Za-z0-9]+`   
Required: No

 ** [logStreamNamePrefix](#API_FilterLogEvents_RequestSyntax) **   <a name="CWL-FilterLogEvents-request-logStreamNamePrefix"></a>
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`, the action returns an `InvalidParameterException` error.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[^:*]*`   
Required: No

 ** [logStreamNames](#API_FilterLogEvents_RequestSyntax) **   <a name="CWL-FilterLogEvents-request-logStreamNames"></a>
Filters the results to only logs from the log streams in this list.  
If you specify a value for both `logStreamNames` and `logStreamNamePrefix`, 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.  
Pattern: `[^:*]*`   
Required: No

 ** [nextToken](#API_FilterLogEvents_RequestSyntax) **   <a name="CWL-FilterLogEvents-request-nextToken"></a>
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](#API_FilterLogEvents_RequestSyntax) **   <a name="CWL-FilterLogEvents-request-startTime"></a>
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

 ** [unmask](#API_FilterLogEvents_RequestSyntax) **   <a name="CWL-FilterLogEvents-request-unmask"></a>
Specify `true` to display the log event fields with all sensitive data unmasked and visible. The default is `false`.  
To use this operation with this parameter, you must be signed into an account with the `logs:Unmask` permission.  
Type: Boolean  
Required: No

## Response Syntax
<a name="API_FilterLogEvents_ResponseSyntax"></a>

```
{
   "events": [ 
      { 
         "eventId": "string",
         "ingestionTime": number,
         "logStreamName": "string",
         "message": "string",
         "timestamp": number
      }
   ],
   "nextToken": "string",
   "searchedLogStreams": [ 
      { 
         "logStreamName": "string",
         "searchedCompletely": boolean
      }
   ]
}
```

## Response Elements
<a name="API_FilterLogEvents_ResponseElements"></a>

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](#API_FilterLogEvents_ResponseSyntax) **   <a name="CWL-FilterLogEvents-response-events"></a>
The matched events.  
Type: Array of [FilteredLogEvent](API_FilteredLogEvent.md) objects

 ** [nextToken](#API_FilterLogEvents_ResponseSyntax) **   <a name="CWL-FilterLogEvents-response-nextToken"></a>
The token to use when requesting the next set of items. The token expires after 24 hours.  
If the results don't include a `nextToken`, then pagination is finished.   
Type: String  
Length Constraints: Minimum length of 1.

 ** [searchedLogStreams](#API_FilterLogEvents_ResponseSyntax) **   <a name="CWL-FilterLogEvents-response-searchedLogStreams"></a>
 **Important** As of May 15, 2020, this parameter is no longer supported. This parameter returns an empty list.  
Indicates which log streams have been searched and whether each has been searched completely.  
Type: Array of [SearchedLogStream](API_SearchedLogStream.md) objects

## Errors
<a name="API_FilterLogEvents_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** 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
<a name="API_FilterLogEvents_Examples"></a>

### To list the events in a log group that contain a pattern
<a name="API_FilterLogEvents_Example_1"></a>

The following example lists the events for the specified log group that contain `ERROR`.

#### Sample Request
<a name="API_FilterLogEvents_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.FilterLogEvents
{
  "logGroupName": "my-log-group",
  "filterPattern": "ERROR"
}
```

#### Sample Response
<a name="API_FilterLogEvents_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
  "events": [
    {
      "ingestionTime": 1396035394997,
      "timestamp": 1396035378988,
      "message": "ERROR Event 1",
      "logStreamName": "my-log-stream-1",
      "eventId": "31132629274945519779805322857203735586714454643391594505"
    },
    {
      "ingestionTime": 1396035394997,
      "timestamp": 1396035378988,
      "message": "ERROR Event 2",
      "logStreamName": "my-log-stream-2",
      "eventId": "31132629274945519779805322857203735586814454643391594505"
    },
    {
      "ingestionTime": 1396035394997,
      "timestamp": 1396035378989,
      "message": "ERROR Event 3",
      "logStreamName": "my-log-stream-3"
      "eventId": "31132629274945519779805322857203735586824454643391594505"
    }
  ],
  "searchedLogStreams": [
    {
      "searchedCompletely": true,
      "logStreamName": "my-log-stream-1"
    },
    {
      "searchedCompletely": true,
      "logStreamName": "my-log-stream-2"
    },
    {
      "searchedCompletely": false,
      "logStreamName": "my-log-stream-3"
    },
  ],
  "nextToken": "ZNUEPl7FcQuXbIH4Swk9D9eFu2XBg-ijZIZlvzz4ea9zZRjw-MMtQtvcoMdmq4T29K7Q6Y1e_KvyfpcT_f_tUw"
}
```

### Example
<a name="API_FilterLogEvents_Example_2"></a>

The following example lists the events for the specified log group that contain `ERROR`.

#### Sample Request
<a name="API_FilterLogEvents_Example_2_Request"></a>

```
{
  "logGroupIdentifier": "arn:aws:logs:us-east-1:123456789012:log-group:monitoring-logGroup-1234:*",
  "filterPattern": "ERROR"
}
```

#### Sample Response
<a name="API_FilterLogEvents_Example_2_Response"></a>

```
{
  "events": [
  {
      "ingestionTime": 1396035394997,
      "timestamp": 1396035378988,
      "message": "ERROR Event 1",
      "logStreamName": "my-log-stream-1",
      "eventId": "31132629274945519779805322857203735586714454643391594505"
  },
  {
     "ingestionTime": 1396035394997,
      "timestamp": 1396035378988,
      "message": "ERROR Event 2",
      "logStreamName": "my-log-stream-2",
      "eventId": "31132629274945519779805322857203735586814454643391594505"
  },
  {
      "ingestionTime": 1396035394997,
      "timestamp": 1396035378989,
      "message": "ERROR Event 3",
      "logStreamName": "my-log-stream-3"
      "eventId": "31132629274945519779805322857203735586824454643391594505"
   } ],
   "searchedLogStreams": [
   {
      "searchedCompletely": true,
      "logStreamName": "my-log-stream-1"
    },
    {
      "searchedCompletely": true,
      "logStreamName": "my-log-stream-2"
    },
    {
      "searchedCompletely": false,
      "logStreamName": "my-log-stream-3"
    }
    ],
    "nextToken": "ZNUEPl7FcQuXbIH4Swk9D9eFu2XBg-ijZIZlvzz4ea9zZRjw-
MMtQtvcoMdmq4T29K7Q6Y1e_KvyfpcT_f_tUw"
}
```

## See Also
<a name="API_FilterLogEvents_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/FilterLogEvents) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/FilterLogEvents) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/FilterLogEvents) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/FilterLogEvents) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/FilterLogEvents) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/FilterLogEvents) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/FilterLogEvents) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/FilterLogEvents) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/FilterLogEvents) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/FilterLogEvents) 

# GetDataProtectionPolicy
<a name="API_GetDataProtectionPolicy"></a>

Returns information about a log group data protection policy.

## Request Syntax
<a name="API_GetDataProtectionPolicy_RequestSyntax"></a>

```
{
   "logGroupIdentifier": "string"
}
```

## Request Parameters
<a name="API_GetDataProtectionPolicy_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [logGroupIdentifier](#API_GetDataProtectionPolicy_RequestSyntax) **   <a name="CWL-GetDataProtectionPolicy-request-logGroupIdentifier"></a>
The name or ARN of the log group that contains the data protection policy that you want to see.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Pattern: `[\w#+=/:,.@-]*`   
Required: Yes

## Response Syntax
<a name="API_GetDataProtectionPolicy_ResponseSyntax"></a>

```
{
   "lastUpdatedTime": number,
   "logGroupIdentifier": "string",
   "policyDocument": "string"
}
```

## Response Elements
<a name="API_GetDataProtectionPolicy_ResponseElements"></a>

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

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

 ** [lastUpdatedTime](#API_GetDataProtectionPolicy_ResponseSyntax) **   <a name="CWL-GetDataProtectionPolicy-response-lastUpdatedTime"></a>
The date and time that this policy was most recently updated.  
Type: Long  
Valid Range: Minimum value of 0.

 ** [logGroupIdentifier](#API_GetDataProtectionPolicy_ResponseSyntax) **   <a name="CWL-GetDataProtectionPolicy-response-logGroupIdentifier"></a>
The log group name or ARN that you specified in your request.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Pattern: `[\w#+=/:,.@-]*` 

 ** [policyDocument](#API_GetDataProtectionPolicy_ResponseSyntax) **   <a name="CWL-GetDataProtectionPolicy-response-policyDocument"></a>
The data protection policy document for this log group.  
Type: String

## Errors
<a name="API_GetDataProtectionPolicy_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
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

## See Also
<a name="API_GetDataProtectionPolicy_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/GetDataProtectionPolicy) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/GetDataProtectionPolicy) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/GetDataProtectionPolicy) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/GetDataProtectionPolicy) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/GetDataProtectionPolicy) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/GetDataProtectionPolicy) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/GetDataProtectionPolicy) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/GetDataProtectionPolicy) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/GetDataProtectionPolicy) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/GetDataProtectionPolicy) 

# GetDelivery
<a name="API_GetDelivery"></a>

Returns complete information about one logical *delivery*. A delivery is a connection between a [https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliverySource.html](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliverySource.html) and a [https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliveryDestination.html](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliveryDestination.html).

A delivery source represents an AWS resource that sends logs to an logs delivery destination. The destination can be CloudWatch Logs, Amazon S3, or Firehose. Only some AWS services support being configured as a delivery source. These services are listed in [Enable logging from AWS services.](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html) 

You need to specify the delivery `id` in this operation. You can find the IDs of the deliveries in your account with the [DescribeDeliveries](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeDeliveries.html) operation.

## Request Syntax
<a name="API_GetDelivery_RequestSyntax"></a>

```
{
   "id": "string"
}
```

## Request Parameters
<a name="API_GetDelivery_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [id](#API_GetDelivery_RequestSyntax) **   <a name="CWL-GetDelivery-request-id"></a>
The ID of the delivery that you want to retrieve.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 64.  
Pattern: `^[0-9A-Za-z]+$`   
Required: Yes

## Response Syntax
<a name="API_GetDelivery_ResponseSyntax"></a>

```
{
   "delivery": { 
      "arn": "string",
      "deliveryDestinationArn": "string",
      "deliveryDestinationType": "string",
      "deliverySourceName": "string",
      "fieldDelimiter": "string",
      "id": "string",
      "recordFields": [ "string" ],
      "s3DeliveryConfiguration": { 
         "enableHiveCompatiblePath": boolean,
         "suffixPath": "string"
      },
      "tags": { 
         "string" : "string" 
      }
   }
}
```

## Response Elements
<a name="API_GetDelivery_ResponseElements"></a>

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

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

 ** [delivery](#API_GetDelivery_ResponseSyntax) **   <a name="CWL-GetDelivery-response-delivery"></a>
A structure that contains information about the delivery.  
Type: [Delivery](API_Delivery.md) object

## Errors
<a name="API_GetDelivery_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ResourceNotFoundException **   
The specified resource does not exist.  
HTTP Status Code: 400

 ** ServiceQuotaExceededException **   
This request exceeds a service quota.  
HTTP Status Code: 400

 ** ServiceUnavailableException **   
The service cannot complete the request.  
HTTP Status Code: 500

 ** ThrottlingException **   
The request was throttled because of quota limits.  
HTTP Status Code: 400

 ** ValidationException **   
One of the parameters for the request is not valid.  
HTTP Status Code: 400

## See Also
<a name="API_GetDelivery_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/GetDelivery) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/GetDelivery) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/GetDelivery) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/GetDelivery) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/GetDelivery) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/GetDelivery) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/GetDelivery) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/GetDelivery) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/GetDelivery) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/GetDelivery) 

# GetDeliveryDestination
<a name="API_GetDeliveryDestination"></a>

Retrieves complete information about one delivery destination.

## Request Syntax
<a name="API_GetDeliveryDestination_RequestSyntax"></a>

```
{
   "name": "string"
}
```

## Request Parameters
<a name="API_GetDeliveryDestination_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [name](#API_GetDeliveryDestination_RequestSyntax) **   <a name="CWL-GetDeliveryDestination-request-name"></a>
The name of the delivery destination that you want to retrieve.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 60.  
Pattern: `[\w-]*`   
Required: Yes

## Response Syntax
<a name="API_GetDeliveryDestination_ResponseSyntax"></a>

```
{
   "deliveryDestination": { 
      "arn": "string",
      "deliveryDestinationConfiguration": { 
         "destinationResourceArn": "string"
      },
      "deliveryDestinationType": "string",
      "name": "string",
      "outputFormat": "string",
      "tags": { 
         "string" : "string" 
      }
   }
}
```

## Response Elements
<a name="API_GetDeliveryDestination_ResponseElements"></a>

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

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

 ** [deliveryDestination](#API_GetDeliveryDestination_ResponseSyntax) **   <a name="CWL-GetDeliveryDestination-response-deliveryDestination"></a>
A structure containing information about the delivery destination.  
Type: [DeliveryDestination](API_DeliveryDestination.md) object

## Errors
<a name="API_GetDeliveryDestination_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ResourceNotFoundException **   
The specified resource does not exist.  
HTTP Status Code: 400

 ** ServiceQuotaExceededException **   
This request exceeds a service quota.  
HTTP Status Code: 400

 ** ServiceUnavailableException **   
The service cannot complete the request.  
HTTP Status Code: 500

 ** ThrottlingException **   
The request was throttled because of quota limits.  
HTTP Status Code: 400

 ** ValidationException **   
One of the parameters for the request is not valid.  
HTTP Status Code: 400

## See Also
<a name="API_GetDeliveryDestination_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/GetDeliveryDestination) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/GetDeliveryDestination) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/GetDeliveryDestination) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/GetDeliveryDestination) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/GetDeliveryDestination) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/GetDeliveryDestination) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/GetDeliveryDestination) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/GetDeliveryDestination) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/GetDeliveryDestination) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/GetDeliveryDestination) 

# GetDeliveryDestinationPolicy
<a name="API_GetDeliveryDestinationPolicy"></a>

Retrieves the delivery destination policy assigned to the delivery destination that you specify. For more information about delivery destinations and their policies, see [PutDeliveryDestinationPolicy](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliveryDestinationPolicy.html).

## Request Syntax
<a name="API_GetDeliveryDestinationPolicy_RequestSyntax"></a>

```
{
   "deliveryDestinationName": "string"
}
```

## Request Parameters
<a name="API_GetDeliveryDestinationPolicy_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [deliveryDestinationName](#API_GetDeliveryDestinationPolicy_RequestSyntax) **   <a name="CWL-GetDeliveryDestinationPolicy-request-deliveryDestinationName"></a>
The name of the delivery destination that you want to retrieve the policy of.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 60.  
Pattern: `[\w-]*`   
Required: Yes

## Response Syntax
<a name="API_GetDeliveryDestinationPolicy_ResponseSyntax"></a>

```
{
   "policy": { 
      "deliveryDestinationPolicy": "string"
   }
}
```

## Response Elements
<a name="API_GetDeliveryDestinationPolicy_ResponseElements"></a>

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

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

 ** [policy](#API_GetDeliveryDestinationPolicy_ResponseSyntax) **   <a name="CWL-GetDeliveryDestinationPolicy-response-policy"></a>
The IAM policy for this delivery destination.  
Type: [Policy](API_Policy.md) object

## Errors
<a name="API_GetDeliveryDestinationPolicy_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ResourceNotFoundException **   
The specified resource does not exist.  
HTTP Status Code: 400

 ** ServiceUnavailableException **   
The service cannot complete the request.  
HTTP Status Code: 500

 ** ValidationException **   
One of the parameters for the request is not valid.  
HTTP Status Code: 400

## See Also
<a name="API_GetDeliveryDestinationPolicy_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/GetDeliveryDestinationPolicy) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/GetDeliveryDestinationPolicy) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/GetDeliveryDestinationPolicy) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/GetDeliveryDestinationPolicy) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/GetDeliveryDestinationPolicy) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/GetDeliveryDestinationPolicy) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/GetDeliveryDestinationPolicy) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/GetDeliveryDestinationPolicy) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/GetDeliveryDestinationPolicy) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/GetDeliveryDestinationPolicy) 

# GetDeliverySource
<a name="API_GetDeliverySource"></a>

Retrieves complete information about one delivery source.

## Request Syntax
<a name="API_GetDeliverySource_RequestSyntax"></a>

```
{
   "name": "string"
}
```

## Request Parameters
<a name="API_GetDeliverySource_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [name](#API_GetDeliverySource_RequestSyntax) **   <a name="CWL-GetDeliverySource-request-name"></a>
The name of the delivery source that you want to retrieve.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 60.  
Pattern: `[\w-]*`   
Required: Yes

## Response Syntax
<a name="API_GetDeliverySource_ResponseSyntax"></a>

```
{
   "deliverySource": { 
      "arn": "string",
      "logType": "string",
      "name": "string",
      "resourceArns": [ "string" ],
      "service": "string",
      "tags": { 
         "string" : "string" 
      }
   }
}
```

## Response Elements
<a name="API_GetDeliverySource_ResponseElements"></a>

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

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

 ** [deliverySource](#API_GetDeliverySource_ResponseSyntax) **   <a name="CWL-GetDeliverySource-response-deliverySource"></a>
A structure containing information about the delivery source.  
Type: [DeliverySource](API_DeliverySource.md) object

## Errors
<a name="API_GetDeliverySource_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ResourceNotFoundException **   
The specified resource does not exist.  
HTTP Status Code: 400

 ** ServiceQuotaExceededException **   
This request exceeds a service quota.  
HTTP Status Code: 400

 ** ServiceUnavailableException **   
The service cannot complete the request.  
HTTP Status Code: 500

 ** ThrottlingException **   
The request was throttled because of quota limits.  
HTTP Status Code: 400

 ** ValidationException **   
One of the parameters for the request is not valid.  
HTTP Status Code: 400

## See Also
<a name="API_GetDeliverySource_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/GetDeliverySource) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/GetDeliverySource) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/GetDeliverySource) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/GetDeliverySource) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/GetDeliverySource) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/GetDeliverySource) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/GetDeliverySource) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/GetDeliverySource) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/GetDeliverySource) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/GetDeliverySource) 

# GetIntegration
<a name="API_GetIntegration"></a>

Returns information about one integration between CloudWatch Logs and OpenSearch Service. 

## Request Syntax
<a name="API_GetIntegration_RequestSyntax"></a>

```
{
   "integrationName": "string"
}
```

## Request Parameters
<a name="API_GetIntegration_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [integrationName](#API_GetIntegration_RequestSyntax) **   <a name="CWL-GetIntegration-request-integrationName"></a>
The name of the integration that you want to find information about. To find the name of your integration, use [ListIntegrations](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_ListIntegrations.html)   
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 50.  
Pattern: `[\.\-_/#A-Za-z0-9]+`   
Required: Yes

## Response Syntax
<a name="API_GetIntegration_ResponseSyntax"></a>

```
{
   "integrationDetails": { ... },
   "integrationName": "string",
   "integrationStatus": "string",
   "integrationType": "string"
}
```

## Response Elements
<a name="API_GetIntegration_ResponseElements"></a>

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

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

 ** [integrationDetails](#API_GetIntegration_ResponseSyntax) **   <a name="CWL-GetIntegration-response-integrationDetails"></a>
A structure that contains information about the integration configuration. For an integration with OpenSearch Service, this includes information about OpenSearch Service resources such as the collection, the workspace, and policies.  
Type: [IntegrationDetails](API_IntegrationDetails.md) object  
 **Note: **This object is a Union. Only one member of this object can be specified or returned.

 ** [integrationName](#API_GetIntegration_ResponseSyntax) **   <a name="CWL-GetIntegration-response-integrationName"></a>
The name of the integration.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 50.  
Pattern: `[\.\-_/#A-Za-z0-9]+` 

 ** [integrationStatus](#API_GetIntegration_ResponseSyntax) **   <a name="CWL-GetIntegration-response-integrationStatus"></a>
The current status of this integration.  
Type: String  
Valid Values: `PROVISIONING | ACTIVE | FAILED` 

 ** [integrationType](#API_GetIntegration_ResponseSyntax) **   <a name="CWL-GetIntegration-response-integrationType"></a>
The type of integration. Integrations with OpenSearch Service have the type `OPENSEARCH`.  
Type: String  
Valid Values: `OPENSEARCH` 

## Errors
<a name="API_GetIntegration_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** 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

## See Also
<a name="API_GetIntegration_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/GetIntegration) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/GetIntegration) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/GetIntegration) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/GetIntegration) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/GetIntegration) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/GetIntegration) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/GetIntegration) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/GetIntegration) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/GetIntegration) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/GetIntegration) 

# GetLogAnomalyDetector
<a name="API_GetLogAnomalyDetector"></a>

Retrieves information about the log anomaly detector that you specify. The AWS KMS key ARN detected is valid.

## Request Syntax
<a name="API_GetLogAnomalyDetector_RequestSyntax"></a>

```
{
   "anomalyDetectorArn": "string"
}
```

## Request Parameters
<a name="API_GetLogAnomalyDetector_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [anomalyDetectorArn](#API_GetLogAnomalyDetector_RequestSyntax) **   <a name="CWL-GetLogAnomalyDetector-request-anomalyDetectorArn"></a>
The ARN of the anomaly detector to retrieve information about. You can find the ARNs of log anomaly detectors in your account by using the [ListLogAnomalyDetectors](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_ListLogAnomalyDetectors.html) operation.  
Type: String  
Length Constraints: Minimum length of 1.  
Pattern: `[\w#+=/:,.@-]*`   
Required: Yes

## Response Syntax
<a name="API_GetLogAnomalyDetector_ResponseSyntax"></a>

```
{
   "anomalyDetectorStatus": "string",
   "anomalyVisibilityTime": number,
   "creationTimeStamp": number,
   "detectorName": "string",
   "evaluationFrequency": "string",
   "filterPattern": "string",
   "kmsKeyId": "string",
   "lastModifiedTimeStamp": number,
   "logGroupArnList": [ "string" ]
}
```

## Response Elements
<a name="API_GetLogAnomalyDetector_ResponseElements"></a>

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

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

 ** [anomalyDetectorStatus](#API_GetLogAnomalyDetector_ResponseSyntax) **   <a name="CWL-GetLogAnomalyDetector-response-anomalyDetectorStatus"></a>
Specifies whether the anomaly detector is currently active. To change its status, use the `enabled` parameter in the [UpdateLogAnomalyDetector](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_UpdateLogAnomalyDetector.html) operation.  
Type: String  
Valid Values: `INITIALIZING | TRAINING | ANALYZING | FAILED | DELETED | PAUSED` 

 ** [anomalyVisibilityTime](#API_GetLogAnomalyDetector_ResponseSyntax) **   <a name="CWL-GetLogAnomalyDetector-response-anomalyVisibilityTime"></a>
The number of days used as the life cycle of anomalies. After this time, anomalies are automatically baselined and the anomaly detector model will treat new occurrences of similar event as normal.   
Type: Long  
Valid Range: Minimum value of 7. Maximum value of 90.

 ** [creationTimeStamp](#API_GetLogAnomalyDetector_ResponseSyntax) **   <a name="CWL-GetLogAnomalyDetector-response-creationTimeStamp"></a>
The date and time when this anomaly detector was created.  
Type: Long  
Valid Range: Minimum value of 0.

 ** [detectorName](#API_GetLogAnomalyDetector_ResponseSyntax) **   <a name="CWL-GetLogAnomalyDetector-response-detectorName"></a>
The name of the log anomaly detector  
Type: String  
Length Constraints: Minimum length of 1.

 ** [evaluationFrequency](#API_GetLogAnomalyDetector_ResponseSyntax) **   <a name="CWL-GetLogAnomalyDetector-response-evaluationFrequency"></a>
Specifies how often the anomaly detector runs and look for anomalies. Set this value according to the frequency that the log group receives new logs. For example, if the log group receives new log events every 10 minutes, then setting `evaluationFrequency` to `FIFTEEN_MIN` might be appropriate.  
Type: String  
Valid Values: `ONE_MIN | FIVE_MIN | TEN_MIN | FIFTEEN_MIN | THIRTY_MIN | ONE_HOUR` 

 ** [filterPattern](#API_GetLogAnomalyDetector_ResponseSyntax) **   <a name="CWL-GetLogAnomalyDetector-response-filterPattern"></a>
A symbolic description of how CloudWatch Logs should interpret the data in each log event. For example, a log event can contain timestamps, IP addresses, strings, and so on. You use the filter pattern to specify what to look for in the log event message.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1024.

 ** [kmsKeyId](#API_GetLogAnomalyDetector_ResponseSyntax) **   <a name="CWL-GetLogAnomalyDetector-response-kmsKeyId"></a>
The ARN of the AWS KMS key assigned to this anomaly detector, if any.  
Type: String  
Length Constraints: Maximum length of 256.

 ** [lastModifiedTimeStamp](#API_GetLogAnomalyDetector_ResponseSyntax) **   <a name="CWL-GetLogAnomalyDetector-response-lastModifiedTimeStamp"></a>
The date and time when this anomaly detector was most recently modified.  
Type: Long  
Valid Range: Minimum value of 0.

 ** [logGroupArnList](#API_GetLogAnomalyDetector_ResponseSyntax) **   <a name="CWL-GetLogAnomalyDetector-response-logGroupArnList"></a>
An array of structures, where each structure contains the ARN of a log group associated with this anomaly detector.  
Type: Array of strings  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Pattern: `[\w#+=/:,.@-]*` 

## Errors
<a name="API_GetLogAnomalyDetector_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
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

## See Also
<a name="API_GetLogAnomalyDetector_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/GetLogAnomalyDetector) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/GetLogAnomalyDetector) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/GetLogAnomalyDetector) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/GetLogAnomalyDetector) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/GetLogAnomalyDetector) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/GetLogAnomalyDetector) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/GetLogAnomalyDetector) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/GetLogAnomalyDetector) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/GetLogAnomalyDetector) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/GetLogAnomalyDetector) 

# GetLogEvents
<a name="API_GetLogEvents"></a>

Lists log events from the specified log stream. You can list all of the log events or filter using a time range.

 `GetLogEvents` is a paginated operation. Each page returned can contain up to 1 MB of log events or up to 10,000 log events. A returned page might only be partially full, or even empty. For example, if the result of a query would return 15,000 log events, the first page isn't guaranteed to have 10,000 log events even if they all fit into 1 MB.

Partially full or empty pages don't necessarily mean that pagination is finished. As long as the `nextBackwardToken` or `nextForwardToken` returned is NOT equal to the `nextToken` that you passed into the API call, there might be more log events available. The token that you use depends on the direction you want to move in along the log stream. The returned tokens are never null.

**Note**  
If you set `startFromHead` to `true` and you don’t include `endTime` in your request, you can end up in a situation where the pagination doesn't terminate. This can happen when the new log events are being added to the target log streams faster than they are being read. This situation is a good use case for the CloudWatch Logs [Live Tail](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatchLogs_LiveTail.html) feature.

If you are using CloudWatch cross-account observability, you can use this operation in a monitoring account and view data from the linked source accounts. For more information, see [CloudWatch cross-account observability](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html).

You can specify the log group to search by using either `logGroupIdentifier` or `logGroupName`. You must include one of these two parameters, but you can't include both. 

**Note**  
If you are using [log transformation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html), the `GetLogEvents` operation returns only the original versions of log events, before they were transformed. To view the transformed versions, you must use a [CloudWatch Logs query.](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AnalyzingLogData.html) 

## Request Syntax
<a name="API_GetLogEvents_RequestSyntax"></a>

```
{
   "endTime": number,
   "limit": number,
   "logGroupIdentifier": "string",
   "logGroupName": "string",
   "logStreamName": "string",
   "nextToken": "string",
   "startFromHead": boolean,
   "startTime": number,
   "unmask": boolean
}
```

## Request Parameters
<a name="API_GetLogEvents_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [endTime](#API_GetLogEvents_RequestSyntax) **   <a name="CWL-GetLogEvents-request-endTime"></a>
The end of the time range, expressed as the number of milliseconds after `Jan 1, 1970 00:00:00 UTC`. Events with a timestamp equal to or later than this time are not included.  
Type: Long  
Valid Range: Minimum value of 0.  
Required: No

 ** [limit](#API_GetLogEvents_RequestSyntax) **   <a name="CWL-GetLogEvents-request-limit"></a>
The maximum number of log events returned. If you don't specify a limit, the default is as many log events as can fit in a response size of 1 MB (up to 10,000 log events).  
Type: Integer  
Valid Range: Minimum value of 1. Maximum value of 10000.  
Required: No

 ** [logGroupIdentifier](#API_GetLogEvents_RequestSyntax) **   <a name="CWL-GetLogEvents-request-logGroupIdentifier"></a>
Specify either the name or ARN of the log group to view events from. If the log group is in a source account and you are using a monitoring account, you must use the log group ARN.  
 You must include either `logGroupIdentifier` or `logGroupName`, but not both. 
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Pattern: `[\w#+=/:,.@-]*`   
Required: No

 ** [logGroupName](#API_GetLogEvents_RequestSyntax) **   <a name="CWL-GetLogEvents-request-logGroupName"></a>
The name of the log group.  
 You must include either `logGroupIdentifier` or `logGroupName`, but not both. 
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[\.\-_/#A-Za-z0-9]+`   
Required: No

 ** [logStreamName](#API_GetLogEvents_RequestSyntax) **   <a name="CWL-GetLogEvents-request-logStreamName"></a>
The name of the log stream.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[^:*]*`   
Required: Yes

 ** [nextToken](#API_GetLogEvents_RequestSyntax) **   <a name="CWL-GetLogEvents-request-nextToken"></a>
The token for the next set of items to return. (You received this token from a previous call.)  
Type: String  
Length Constraints: Minimum length of 1.  
Required: No

 ** [startFromHead](#API_GetLogEvents_RequestSyntax) **   <a name="CWL-GetLogEvents-request-startFromHead"></a>
If the value is true, the earliest log events are returned first. If the value is false, the latest log events are returned first. The default value is false.  
If you are using a previous `nextForwardToken` value as the `nextToken` in this operation, you must specify `true` for `startFromHead`.  
Type: Boolean  
Required: No

 ** [startTime](#API_GetLogEvents_RequestSyntax) **   <a name="CWL-GetLogEvents-request-startTime"></a>
The start of the time range, expressed as the number of milliseconds after `Jan 1, 1970 00:00:00 UTC`. Events with a timestamp equal to this time or later than this time are included. Events with a timestamp earlier than this time are not included.  
Type: Long  
Valid Range: Minimum value of 0.  
Required: No

 ** [unmask](#API_GetLogEvents_RequestSyntax) **   <a name="CWL-GetLogEvents-request-unmask"></a>
Specify `true` to display the log event fields with all sensitive data unmasked and visible. The default is `false`.  
To use this operation with this parameter, you must be signed into an account with the `logs:Unmask` permission.  
Type: Boolean  
Required: No

## Response Syntax
<a name="API_GetLogEvents_ResponseSyntax"></a>

```
{
   "events": [ 
      { 
         "ingestionTime": number,
         "message": "string",
         "timestamp": number
      }
   ],
   "nextBackwardToken": "string",
   "nextForwardToken": "string"
}
```

## Response Elements
<a name="API_GetLogEvents_ResponseElements"></a>

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](#API_GetLogEvents_ResponseSyntax) **   <a name="CWL-GetLogEvents-response-events"></a>
The events.  
Type: Array of [OutputLogEvent](API_OutputLogEvent.md) objects

 ** [nextBackwardToken](#API_GetLogEvents_ResponseSyntax) **   <a name="CWL-GetLogEvents-response-nextBackwardToken"></a>
The token for the next set of items in the backward direction. The token expires after 24 hours. This token is not null. If you have reached the end of the stream, it returns the same token you passed in.  
Type: String  
Length Constraints: Minimum length of 1.

 ** [nextForwardToken](#API_GetLogEvents_ResponseSyntax) **   <a name="CWL-GetLogEvents-response-nextForwardToken"></a>
The token for the next set of items in the forward direction. The token expires after 24 hours. If you have reached the end of the stream, it returns the same token you passed in.  
Type: String  
Length Constraints: Minimum length of 1.

## Errors
<a name="API_GetLogEvents_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** 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
<a name="API_GetLogEvents_Examples"></a>

### To list all the events for a log stream
<a name="API_GetLogEvents_Example_1"></a>

The following example lists all events for the specified log stream.

#### Sample Request
<a name="API_GetLogEvents_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.GetLogEvents
{
  "logGroupName": "my-log-group",
  "logStreamName": "my-log-stream"
}
```

#### Sample Response
<a name="API_GetLogEvents_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
  "events": [
    {
      "ingestionTime": 1396035394997,
      "timestamp": 1396035378988,
      "message": "Example event 1"
    },
    {
      "ingestionTime": 1396035394997,
      "timestamp": 1396035378988,
      "message": "Example event 2"
    },
    {
      "ingestionTime": 1396035394997,
      "timestamp": 1396035378989,
      "message": "Example event 3"
    }
  ],
  "nextBackwardToken": "b/31132629274945519779805322857203735586714454643391594505",
  "nextForwardToken": "f/31132629323784151764587387538205132201699397759403884544"
}
```

### Example
<a name="API_GetLogEvents_Example_2"></a>

The following example lists all events for the specified log stream.

#### Sample Request
<a name="API_GetLogEvents_Example_2_Request"></a>

```
{
  "logGroupIdentifier": "arn:aws:logs:us-east-1:123456789012:log-group:monitoring-logGroup-1234:*",
  "logStreamName": "my-log-stream"
}
```

#### Sample Response
<a name="API_GetLogEvents_Example_2_Response"></a>

```
{
    "events": [
    {
      "ingestionTime": 1396035394997,
      "timestamp": 1396035378988,
      "message": "Example event 1"
    },
    {
      "ingestionTime": 1396035394997,
      "timestamp": 1396035378988,
      "message": "Example event 2"
    },
    {
      "ingestionTime": 1396035394997,
      "timestamp": 1396035378989,
      "message": "Example event 3"
    } ],
    "nextBackwardToken": "b/31132629274945519779805322857203735586714454643391594505",
    "nextForwardToken": "f/31132629323784151764587387538205132201699397759403884544"
}
```

## See Also
<a name="API_GetLogEvents_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/GetLogEvents) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/GetLogEvents) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/GetLogEvents) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/GetLogEvents) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/GetLogEvents) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/GetLogEvents) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/GetLogEvents) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/GetLogEvents) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/GetLogEvents) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/GetLogEvents) 

# GetLogFields
<a name="API_GetLogFields"></a>

Discovers available fields for a specific data source and type. The response includes any field modifications introduced through pipelines, such as new fields or changed field types. 

## Request Syntax
<a name="API_GetLogFields_RequestSyntax"></a>

```
{
   "dataSourceName": "string",
   "dataSourceType": "string"
}
```

## Request Parameters
<a name="API_GetLogFields_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [dataSourceName](#API_GetLogFields_RequestSyntax) **   <a name="CWL-GetLogFields-request-dataSourceName"></a>
The name of the data source to retrieve log fields for.  
Type: String  
Required: Yes

 ** [dataSourceType](#API_GetLogFields_RequestSyntax) **   <a name="CWL-GetLogFields-request-dataSourceType"></a>
The type of the data source to retrieve log fields for.  
Type: String  
Required: Yes

## Response Syntax
<a name="API_GetLogFields_ResponseSyntax"></a>

```
{
   "logFields": [ 
      { 
         "logFieldName": "string",
         "logFieldType": { 
            "element": "LogFieldType",
            "fields": [ 
               "LogFieldsListItem"
            ],
            "type": "string"
         }
      }
   ]
}
```

## Response Elements
<a name="API_GetLogFields_ResponseElements"></a>

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

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

 ** [logFields](#API_GetLogFields_ResponseSyntax) **   <a name="CWL-GetLogFields-response-logFields"></a>
The list of log fields for the specified data source, including field names and their data types.  
Type: Array of [LogFieldsListItem](API_LogFieldsListItem.md) objects

## Errors
<a name="API_GetLogFields_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
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

## See Also
<a name="API_GetLogFields_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/GetLogFields) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/GetLogFields) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/GetLogFields) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/GetLogFields) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/GetLogFields) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/GetLogFields) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/GetLogFields) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/GetLogFields) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/GetLogFields) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/GetLogFields) 

# GetLogGroupFields
<a name="API_GetLogGroupFields"></a>

Returns a list of the fields that are included in log events in the specified log group. Includes the percentage of log events that contain each field. The search is limited to a time period that you specify.

This operation is used for discovering fields within log group events. For discovering fields across data sources, use the GetLogFields operation.

You can specify the log group to search by using either `logGroupIdentifier` or `logGroupName`. You must specify one of these parameters, but you can't specify both. 

In the results, fields that start with `@` are fields generated by CloudWatch Logs. For example, `@timestamp` is the timestamp of each log event. For more information about the fields that are generated by CloudWatch logs, see [Supported Logs and Discovered Fields](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_AnalyzeLogData-discoverable-fields.html).

The response results are sorted by the frequency percentage, starting with the highest percentage.

If you are using CloudWatch cross-account observability, you can use this operation in a monitoring account and view data from the linked source accounts. For more information, see [CloudWatch cross-account observability](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html).

## Request Syntax
<a name="API_GetLogGroupFields_RequestSyntax"></a>

```
{
   "logGroupIdentifier": "string",
   "logGroupName": "string",
   "time": number
}
```

## Request Parameters
<a name="API_GetLogGroupFields_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [logGroupIdentifier](#API_GetLogGroupFields_RequestSyntax) **   <a name="CWL-GetLogGroupFields-request-logGroupIdentifier"></a>
Specify either the name or ARN of the log group to view. If the log group is in a source account and you are using a monitoring account, you must specify the ARN.  
 You must include either `logGroupIdentifier` or `logGroupName`, but not both. 
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Pattern: `[\w#+=/:,.@-]*`   
Required: No

 ** [logGroupName](#API_GetLogGroupFields_RequestSyntax) **   <a name="CWL-GetLogGroupFields-request-logGroupName"></a>
The name of the log group to search.  
 You must include either `logGroupIdentifier` or `logGroupName`, but not both. 
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[\.\-_/#A-Za-z0-9]+`   
Required: No

 ** [time](#API_GetLogGroupFields_RequestSyntax) **   <a name="CWL-GetLogGroupFields-request-time"></a>
The time to set as the center of the query. If you specify `time`, the 8 minutes before and 8 minutes after this time are searched. If you omit `time`, the most recent 15 minutes up to the current time are searched.  
The `time` value is specified as epoch time, which is the number of seconds since `January 1, 1970, 00:00:00 UTC`.  
Type: Long  
Valid Range: Minimum value of 0.  
Required: No

## Response Syntax
<a name="API_GetLogGroupFields_ResponseSyntax"></a>

```
{
   "logGroupFields": [ 
      { 
         "name": "string",
         "percent": number
      }
   ]
}
```

## Response Elements
<a name="API_GetLogGroupFields_ResponseElements"></a>

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

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

 ** [logGroupFields](#API_GetLogGroupFields_ResponseSyntax) **   <a name="CWL-GetLogGroupFields-response-logGroupFields"></a>
The array of fields found in the query. Each object in the array contains the name of the field, along with the percentage of time it appeared in the log events that were queried.  
Type: Array of [LogGroupField](API_LogGroupField.md) objects

## Errors
<a name="API_GetLogGroupFields_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** LimitExceededException **   
You have reached the maximum number of resources that can be created.  
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
<a name="API_GetLogGroupFields_Examples"></a>

### Retrieve fields found in log events in a log group
<a name="API_GetLogGroupFields_Example_1"></a>

The following example lists the log events and how often they occur in `MyLogGroup` for the 15 minutes before November 1, 2018, 00:00:00UTC.

#### Sample Request
<a name="API_GetLogGroupFields_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.GetLogGroupFields
{
   "logGroupName": "MyLogGroup",
   "time": 1541030400
}
```

#### Sample Response
<a name="API_GetLogGroupFields_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
    "logGroupFields": [
        {
            "name": "@timestamp",
            "percent": 100
        },
        {
            "name": "@message",
            "percent": 100
        },
        {
            "name": "@logStream",
            "percent": 100
        },
        {
            "name": "type",
            "percent": 57
        },
        {
            "name": "duration",
            "percent": 13
        }
    ]
}
```

### Example
<a name="API_GetLogGroupFields_Example_2"></a>

The following example lists the log events and how often they occur in `MyLogGroup` for the 15 minutes before November 1, 2018, 00:00:00UTC.

#### Sample Request
<a name="API_GetLogGroupFields_Example_2_Request"></a>

```
{
  "logGroupIdentifier": "arn:aws:logs:us-east-1:123456789012:log-group:monitoring-logGroup-1234:*",
  "time": 1541030400
}
```

#### Sample Response
<a name="API_GetLogGroupFields_Example_2_Response"></a>

```
{
    "logGroupFields": [
    {
        "name": "@timestamp",
        "percent": 100
    },
    {
      "name": "@message",
      "percent": 100
    },
    {
       "name": "@logStream",
       "percent": 100
    },
    {
       "name": "type",
       "percent": 57
    },
    {
       "name": "duration",
       "percent": 13
   }
] }
```

## See Also
<a name="API_GetLogGroupFields_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/GetLogGroupFields) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/GetLogGroupFields) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/GetLogGroupFields) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/GetLogGroupFields) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/GetLogGroupFields) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/GetLogGroupFields) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/GetLogGroupFields) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/GetLogGroupFields) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/GetLogGroupFields) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/GetLogGroupFields) 

# GetLogObject
<a name="API_GetLogObject"></a>

Retrieves a large logging object (LLO) and streams it back. This API is used to fetch the content of large portions of log events that have been ingested through the PutOpenTelemetryLogs API. When log events contain fields that would cause the total event size to exceed 1MB, CloudWatch Logs automatically processes up to 10 fields, starting with the largest fields. Each field is truncated as needed to keep the total event size as close to 1MB as possible. The excess portions are stored as Large Log Objects (LLOs) and these fields are processed separately and LLO reference system fields (in the format `@ptr.$[path.to.field]`) are added. The path in the reference field reflects the original JSON structure where the large field was located. For example, this could be `@ptr.$['input']['message']`, `@ptr.$['AAA']['BBB']['CCC']['DDD']`, `@ptr.$['AAA']`, or any other path matching your log structure.

**Note**  
The `GetLogObject` API routes requests using SDK host prefix injection. SDK versions released before April 1, 2026 route to `streaming-logs.Region.amazonaws.com`, which does not support VPC endpoints. SDK versions released on or after April 1, 2026 route to `stream-logs.Region.amazonaws.com`, which supports VPC endpoints. To set up a VPC endpoint for this API, see [Creating a VPC endpoint for CloudWatch Logs ](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/cloudwatch-logs-and-interface-VPC.html#create-VPC-endpoint-for-CloudWatchLogs).

## Request Syntax
<a name="API_GetLogObject_RequestSyntax"></a>

```
{
   "logObjectPointer": "string",
   "unmask": boolean
}
```

## Request Parameters
<a name="API_GetLogObject_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [logObjectPointer](#API_GetLogObject_RequestSyntax) **   <a name="CWL-GetLogObject-request-logObjectPointer"></a>
A pointer to the specific log object to retrieve. This is a required parameter that uniquely identifies the log object within CloudWatch Logs. The pointer is typically obtained from a previous query or filter operation.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Required: Yes

 ** [unmask](#API_GetLogObject_RequestSyntax) **   <a name="CWL-GetLogObject-request-unmask"></a>
A boolean flag that indicates whether to unmask sensitive log data. When set to true, any masked or redacted data in the log object will be displayed in its original form. Default is false.  
Type: Boolean  
Required: No

## Response Syntax
<a name="API_GetLogObject_ResponseSyntax"></a>

```
{
   "fieldStream": { 
      "fields": { 
         "data": blob
      },
      "InternalStreamingException": { 
      }
   }
}
```

## Response Elements
<a name="API_GetLogObject_ResponseElements"></a>

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

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

 ** [fieldStream](#API_GetLogObject_ResponseSyntax) **   <a name="CWL-GetLogObject-response-fieldStream"></a>
A stream of structured log data returned by the GetLogObject operation. This stream contains log events with their associated metadata and extracted fields.  
Type: [GetLogObjectResponseStream](API_GetLogObjectResponseStream.md) object

## Errors
<a name="API_GetLogObject_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have sufficient permissions to perform this action.  
HTTP Status Code: 400

 ** InvalidOperationException **   
The operation is not valid on the specified resource.  
HTTP Status Code: 400

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** LimitExceededException **   
You have reached the maximum number of resources that can be created.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
The specified resource does not exist.  
HTTP Status Code: 400

## See Also
<a name="API_GetLogObject_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/GetLogObject) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/GetLogObject) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/GetLogObject) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/GetLogObject) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/GetLogObject) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/GetLogObject) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/GetLogObject) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/GetLogObject) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/GetLogObject) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/GetLogObject) 

# GetLogRecord
<a name="API_GetLogRecord"></a>

Retrieves all of the fields and values of a single log event. All fields are retrieved, even if the original query that produced the `logRecordPointer` retrieved only a subset of fields. Fields are returned as field name/field value pairs.

The full unparsed log event is returned within `@message`.

## Request Syntax
<a name="API_GetLogRecord_RequestSyntax"></a>

```
{
   "logRecordPointer": "string",
   "unmask": boolean
}
```

## Request Parameters
<a name="API_GetLogRecord_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [logRecordPointer](#API_GetLogRecord_RequestSyntax) **   <a name="CWL-GetLogRecord-request-logRecordPointer"></a>
The pointer corresponding to the log event record you want to retrieve. You get this from the response of a `GetQueryResults` operation. In that response, the value of the `@ptr` field for a log event is the value to use as `logRecordPointer` to retrieve that complete log event record.  
Type: String  
Required: Yes

 ** [unmask](#API_GetLogRecord_RequestSyntax) **   <a name="CWL-GetLogRecord-request-unmask"></a>
Specify `true` to display the log event fields with all sensitive data unmasked and visible. The default is `false`.  
To use this operation with this parameter, you must be signed into an account with the `logs:Unmask` permission.  
Type: Boolean  
Required: No

## Response Syntax
<a name="API_GetLogRecord_ResponseSyntax"></a>

```
{
   "logRecord": { 
      "string" : "string" 
   }
}
```

## Response Elements
<a name="API_GetLogRecord_ResponseElements"></a>

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

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

 ** [logRecord](#API_GetLogRecord_ResponseSyntax) **   <a name="CWL-GetLogRecord-response-logRecord"></a>
The requested log event, as a JSON string.  
Type: String to string map

## Errors
<a name="API_GetLogRecord_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** LimitExceededException **   
You have reached the maximum number of resources that can be created.  
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
<a name="API_GetLogRecord_Examples"></a>

### To retrieve all fields for a specified log event
<a name="API_GetLogRecord_Example_1"></a>

The following example retrieves the fields for a specified log event.

#### Sample Request
<a name="API_GetLogRecord_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.GetLogRecord
{
   "logRecordPointer": "123456789"
}
```

#### Sample Response
<a name="API_GetLogRecord_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
   "logRecord": {
      "@timestamp" : "1536857812",
      "@message" : "123456789012 eni-1234567890abcde123 6 33 ACCEPT"
      "accountId" : "123456789012",
      "interfaceId" : "eni-1234567890abcde123",
      "protocol" : "6",
      "packets" : "33",
      "action" : "ACCEPT"
   }
}
```

## See Also
<a name="API_GetLogRecord_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/GetLogRecord) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/GetLogRecord) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/GetLogRecord) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/GetLogRecord) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/GetLogRecord) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/GetLogRecord) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/GetLogRecord) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/GetLogRecord) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/GetLogRecord) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/GetLogRecord) 

# GetLookupTable
<a name="API_GetLookupTable"></a>

Retrieves the full content of a lookup table, including the CSV data.

## Request Syntax
<a name="API_GetLookupTable_RequestSyntax"></a>

```
{
   "lookupTableArn": "string"
}
```

## Request Parameters
<a name="API_GetLookupTable_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [lookupTableArn](#API_GetLookupTable_RequestSyntax) **   <a name="CWL-GetLookupTable-request-lookupTableArn"></a>
The ARN of the lookup table to retrieve.  
Type: String  
Required: Yes

## Response Syntax
<a name="API_GetLookupTable_ResponseSyntax"></a>

```
{
   "description": "string",
   "kmsKeyId": "string",
   "lastUpdatedTime": number,
   "lookupTableArn": "string",
   "lookupTableName": "string",
   "sizeBytes": number,
   "tableBody": "string"
}
```

## Response Elements
<a name="API_GetLookupTable_ResponseElements"></a>

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

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

 ** [description](#API_GetLookupTable_ResponseSyntax) **   <a name="CWL-GetLookupTable-response-description"></a>
The description of the lookup table.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1024.

 ** [kmsKeyId](#API_GetLookupTable_ResponseSyntax) **   <a name="CWL-GetLookupTable-response-kmsKeyId"></a>
The ARN of the AWS KMS key used to encrypt the lookup table data, if applicable.  
Type: String  
Length Constraints: Maximum length of 256.

 ** [lastUpdatedTime](#API_GetLookupTable_ResponseSyntax) **   <a name="CWL-GetLookupTable-response-lastUpdatedTime"></a>
The time when the lookup table was last updated, expressed as the number of milliseconds after `Jan 1, 1970 00:00:00 UTC`.  
Type: Long  
Valid Range: Minimum value of 0.

 ** [lookupTableArn](#API_GetLookupTable_ResponseSyntax) **   <a name="CWL-GetLookupTable-response-lookupTableArn"></a>
The ARN of the lookup table.  
Type: String

 ** [lookupTableName](#API_GetLookupTable_ResponseSyntax) **   <a name="CWL-GetLookupTable-response-lookupTableName"></a>
The name of the lookup table.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 256.  
Pattern: `^[a-zA-Z0-9_]+$` 

 ** [sizeBytes](#API_GetLookupTable_ResponseSyntax) **   <a name="CWL-GetLookupTable-response-sizeBytes"></a>
The size of the lookup table in bytes.  
Type: Long  
Valid Range: Minimum value of 0.

 ** [tableBody](#API_GetLookupTable_ResponseSyntax) **   <a name="CWL-GetLookupTable-response-tableBody"></a>
The full CSV content of the lookup table.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 10485760.

## Errors
<a name="API_GetLookupTable_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have sufficient permissions to perform this action.  
HTTP Status Code: 400

 ** 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

## See Also
<a name="API_GetLookupTable_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/GetLookupTable) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/GetLookupTable) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/GetLookupTable) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/GetLookupTable) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/GetLookupTable) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/GetLookupTable) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/GetLookupTable) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/GetLookupTable) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/GetLookupTable) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/GetLookupTable) 

# GetQueryResults
<a name="API_GetQueryResults"></a>

Returns the results from the specified query.

Only the fields requested in the query are returned, along with a `@ptr` field, which is the identifier for the log record. You can use the value of `@ptr` in a [GetLogRecord](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_GetLogRecord.html) operation to get the full log record.

 `GetQueryResults` does not start running a query. To run a query, use [StartQuery](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_StartQuery.html). For more information about how long results of previous queries are available, see [CloudWatch Logs quotas](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/cloudwatch_limits_cwl.html).

If the value of the `Status` field in the output is `Running`, this operation returns only partial results. If you see a value of `Scheduled` or `Running` for the status, you can retry the operation later to see the final results. 

This operation is used both for retrieving results from interactive queries and from automated scheduled query executions. Scheduled queries use `GetQueryResults` internally to retrieve query results for processing and delivery to configured destinations.

If you are using CloudWatch cross-account observability, you can use this operation in a monitoring account to start queries in linked source accounts. For more information, see [CloudWatch cross-account observability](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html).

## Request Syntax
<a name="API_GetQueryResults_RequestSyntax"></a>

```
{
   "queryId": "string"
}
```

## Request Parameters
<a name="API_GetQueryResults_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [queryId](#API_GetQueryResults_RequestSyntax) **   <a name="CWL-GetQueryResults-request-queryId"></a>
The ID number of the query.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 256.  
Required: Yes

## Response Syntax
<a name="API_GetQueryResults_ResponseSyntax"></a>

```
{
   "encryptionKey": "string",
   "queryLanguage": "string",
   "results": [ 
      [ 
         { 
            "field": "string",
            "value": "string"
         }
      ]
   ],
   "statistics": { 
      "bytesScanned": number,
      "estimatedBytesSkipped": number,
      "estimatedRecordsSkipped": number,
      "logGroupsScanned": number,
      "recordsMatched": number,
      "recordsScanned": number
   },
   "status": "string"
}
```

## Response Elements
<a name="API_GetQueryResults_ResponseElements"></a>

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

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

 ** [encryptionKey](#API_GetQueryResults_ResponseSyntax) **   <a name="CWL-GetQueryResults-response-encryptionKey"></a>
If you associated an AWS KMS key with the CloudWatch Logs Insights query results in this account, this field displays the ARN of the key that's used to encrypt the query results when [StartQuery](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_StartQuery.html) stores them.  
Type: String  
Length Constraints: Maximum length of 256.

 ** [queryLanguage](#API_GetQueryResults_ResponseSyntax) **   <a name="CWL-GetQueryResults-response-queryLanguage"></a>
The query language used for this query. For more information about the query languages that CloudWatch Logs supports, see [Supported query languages](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_AnalyzeLogData_Languages.html).  
Type: String  
Valid Values: `CWLI | SQL | PPL` 

 ** [results](#API_GetQueryResults_ResponseSyntax) **   <a name="CWL-GetQueryResults-response-results"></a>
The log events that matched the query criteria during the most recent time it ran.  
The `results` value is an array of arrays. Each log event is one object in the top-level array. Each of these log event objects is an array of `field`/`value` pairs.  
Type: Array of arrays of [ResultField](API_ResultField.md) objects

 ** [statistics](#API_GetQueryResults_ResponseSyntax) **   <a name="CWL-GetQueryResults-response-statistics"></a>
Includes the number of log events scanned by the query, the number of log events that matched the query criteria, and the total number of bytes in the scanned log events. These values reflect the full raw results of the query.  
Type: [QueryStatistics](API_QueryStatistics.md) object

 ** [status](#API_GetQueryResults_ResponseSyntax) **   <a name="CWL-GetQueryResults-response-status"></a>
The status of the most recent running of the query. Possible values are `Cancelled`, `Complete`, `Failed`, `Running`, `Scheduled`, `Timeout`, and `Unknown`.  
Queries time out after 60 minutes of runtime. To avoid having your queries time out, reduce the time range being searched or partition your query into a number of queries.  
Type: String  
Valid Values: `Scheduled | Running | Complete | Failed | Cancelled | Timeout | Unknown` 

## Errors
<a name="API_GetQueryResults_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** 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
<a name="API_GetQueryResults_Examples"></a>

### Get results from a recent query
<a name="API_GetQueryResults_Example_1"></a>

The following returns the results from a specified query.

#### Sample Request
<a name="API_GetQueryResults_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.GetQueryResults
{
   "queryId": "12ab3456-12ab-123a-789e-1234567890ab"
}
```

#### Sample Response
<a name="API_GetQueryResults_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
    "results": [
        [
            {
                "field": "LogEvent1-field1-name",
                "value": "LogEvent1-field1-value"
            },
            {
                "field": "LogEvent1-field2-name",
                "value": "LogEvent1-field2-value"
            },
            ...
            {
                "field": "LogEvent1-fieldX-name",
                "value": "LogEvent1-fieldX-value"
            }
        ],
        [
            {
                "field": "LogEvent2-field1-name",
                "value": "LogEvent2-field1-value"
            },
            {
                "field": "LogEvent2-field2-name",
                "value": "LogEvent2-field2-value"
            },
            ...
            {
                "field": "LogEvent2-fieldX-name",
                "value": "LogEvent2-fieldX-value"
            }
        ],
        [
            {
                "field": "LogEventZ-field1-name",
                "value": "LogEventZ-field1-value"
            },
            {
                "field": "LogEventZ-field2-name",
                "value": "LogEventZ-field2-value"
            },
            ...
            {
                "field": "LogEventZ-fieldX-name",
                "value": "LogEventZ-fieldX-value"
            }
        ]
    ],
    "statistics": {
        "bytesScanned": 81349723,
        "recordsMatched": 360851,
        "recordsScanned": 610956
    },
    "status": "Complete"
}
```

## See Also
<a name="API_GetQueryResults_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/GetQueryResults) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/GetQueryResults) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/GetQueryResults) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/GetQueryResults) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/GetQueryResults) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/GetQueryResults) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/GetQueryResults) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/GetQueryResults) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/GetQueryResults) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/GetQueryResults) 

# GetScheduledQuery
<a name="API_GetScheduledQuery"></a>

Retrieves details about a specific scheduled query, including its configuration, execution status, and metadata.

## Request Syntax
<a name="API_GetScheduledQuery_RequestSyntax"></a>

```
{
   "identifier": "string"
}
```

## Request Parameters
<a name="API_GetScheduledQuery_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [identifier](#API_GetScheduledQuery_RequestSyntax) **   <a name="CWL-GetScheduledQuery-request-identifier"></a>
The ARN or name of the scheduled query to retrieve.  
Type: String  
Pattern: `[\w#+=/:,.@-]*`   
Required: Yes

## Response Syntax
<a name="API_GetScheduledQuery_ResponseSyntax"></a>

```
{
   "creationTime": number,
   "description": "string",
   "destinationConfiguration": { 
      "s3Configuration": { 
         "destinationIdentifier": "string",
         "kmsKeyId": "string",
         "ownerAccountId": "string",
         "roleArn": "string"
      }
   },
   "executionRoleArn": "string",
   "lastExecutionStatus": "string",
   "lastTriggeredTime": number,
   "lastUpdatedTime": number,
   "logGroupIdentifiers": [ "string" ],
   "name": "string",
   "queryLanguage": "string",
   "queryString": "string",
   "scheduledQueryArn": "string",
   "scheduleEndTime": number,
   "scheduleExpression": "string",
   "scheduleStartTime": number,
   "startTimeOffset": number,
   "state": "string",
   "timezone": "string"
}
```

## Response Elements
<a name="API_GetScheduledQuery_ResponseElements"></a>

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

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

 ** [creationTime](#API_GetScheduledQuery_ResponseSyntax) **   <a name="CWL-GetScheduledQuery-response-creationTime"></a>
The timestamp when the scheduled query was created.  
Type: Long  
Valid Range: Minimum value of 0.

 ** [description](#API_GetScheduledQuery_ResponseSyntax) **   <a name="CWL-GetScheduledQuery-response-description"></a>
The description of the scheduled query.  
Type: String  
Length Constraints: Maximum length of 1024.

 ** [destinationConfiguration](#API_GetScheduledQuery_ResponseSyntax) **   <a name="CWL-GetScheduledQuery-response-destinationConfiguration"></a>
Configuration for where query results are delivered.  
Type: [DestinationConfiguration](API_DestinationConfiguration.md) object

 ** [executionRoleArn](#API_GetScheduledQuery_ResponseSyntax) **   <a name="CWL-GetScheduledQuery-response-executionRoleArn"></a>
The ARN of the IAM role used to execute the query and deliver results.  
Type: String  
Length Constraints: Minimum length of 1.

 ** [lastExecutionStatus](#API_GetScheduledQuery_ResponseSyntax) **   <a name="CWL-GetScheduledQuery-response-lastExecutionStatus"></a>
The status of the most recent execution of the scheduled query.  
Type: String  
Valid Values: `Running | InvalidQuery | Complete | Failed | Timeout` 

 ** [lastTriggeredTime](#API_GetScheduledQuery_ResponseSyntax) **   <a name="CWL-GetScheduledQuery-response-lastTriggeredTime"></a>
The timestamp when the scheduled query was last executed.  
Type: Long  
Valid Range: Minimum value of 0.

 ** [lastUpdatedTime](#API_GetScheduledQuery_ResponseSyntax) **   <a name="CWL-GetScheduledQuery-response-lastUpdatedTime"></a>
The timestamp when the scheduled query was last updated.  
Type: Long  
Valid Range: Minimum value of 0.

 ** [logGroupIdentifiers](#API_GetScheduledQuery_ResponseSyntax) **   <a name="CWL-GetScheduledQuery-response-logGroupIdentifiers"></a>
The log groups queried by the scheduled query.  
Type: Array of strings  
Array Members: Minimum number of 1 item. Maximum number of 50 items.  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Pattern: `[\w#+=/:,.@-]*` 

 ** [name](#API_GetScheduledQuery_ResponseSyntax) **   <a name="CWL-GetScheduledQuery-response-name"></a>
The name of the scheduled query.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 255.  
Pattern: `^[a-zA-Z0-9_\-/.#]+$` 

 ** [queryLanguage](#API_GetScheduledQuery_ResponseSyntax) **   <a name="CWL-GetScheduledQuery-response-queryLanguage"></a>
The query language used by the scheduled query.  
Type: String  
Valid Values: `CWLI | SQL | PPL` 

 ** [queryString](#API_GetScheduledQuery_ResponseSyntax) **   <a name="CWL-GetScheduledQuery-response-queryString"></a>
The query string executed by the scheduled query.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 10000.

 ** [scheduledQueryArn](#API_GetScheduledQuery_ResponseSyntax) **   <a name="CWL-GetScheduledQuery-response-scheduledQueryArn"></a>
The ARN of the scheduled query.  
Type: String

 ** [scheduleEndTime](#API_GetScheduledQuery_ResponseSyntax) **   <a name="CWL-GetScheduledQuery-response-scheduleEndTime"></a>
The end time for the scheduled query in Unix epoch format.  
Type: Long  
Valid Range: Minimum value of 0.

 ** [scheduleExpression](#API_GetScheduledQuery_ResponseSyntax) **   <a name="CWL-GetScheduledQuery-response-scheduleExpression"></a>
The cron expression that defines when the scheduled query runs.  
Type: String  
Length Constraints: Maximum length of 256.

 ** [scheduleStartTime](#API_GetScheduledQuery_ResponseSyntax) **   <a name="CWL-GetScheduledQuery-response-scheduleStartTime"></a>
The start time for the scheduled query in Unix epoch format.  
Type: Long  
Valid Range: Minimum value of 0.

 ** [startTimeOffset](#API_GetScheduledQuery_ResponseSyntax) **   <a name="CWL-GetScheduledQuery-response-startTimeOffset"></a>
The time offset in seconds that defines the lookback period for the query.  
Type: Long

 ** [state](#API_GetScheduledQuery_ResponseSyntax) **   <a name="CWL-GetScheduledQuery-response-state"></a>
The current state of the scheduled query.  
Type: String  
Valid Values: `ENABLED | DISABLED` 

 ** [timezone](#API_GetScheduledQuery_ResponseSyntax) **   <a name="CWL-GetScheduledQuery-response-timezone"></a>
The timezone used for evaluating the schedule expression.  
Type: String  
Length Constraints: Minimum length of 1.

## Errors
<a name="API_GetScheduledQuery_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have sufficient permissions to perform this action.  
HTTP Status Code: 400

 ** InternalServerException **   
An internal server error occurred while processing the request. This exception is returned when the service encounters an unexpected condition that prevents it from fulfilling the request.  
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The specified resource does not exist.  
HTTP Status Code: 400

 ** ThrottlingException **   
The request was throttled because of quota limits.  
HTTP Status Code: 400

 ** ValidationException **   
One of the parameters for the request is not valid.  
HTTP Status Code: 400

## See Also
<a name="API_GetScheduledQuery_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/GetScheduledQuery) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/GetScheduledQuery) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/GetScheduledQuery) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/GetScheduledQuery) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/GetScheduledQuery) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/GetScheduledQuery) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/GetScheduledQuery) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/GetScheduledQuery) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/GetScheduledQuery) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/GetScheduledQuery) 

# GetScheduledQueryHistory
<a name="API_GetScheduledQueryHistory"></a>

Retrieves the execution history of a scheduled query within a specified time range, including query results and destination processing status.

## Request Syntax
<a name="API_GetScheduledQueryHistory_RequestSyntax"></a>

```
{
   "endTime": number,
   "executionStatuses": [ "string" ],
   "identifier": "string",
   "maxResults": number,
   "nextToken": "string",
   "startTime": number
}
```

## Request Parameters
<a name="API_GetScheduledQueryHistory_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [endTime](#API_GetScheduledQueryHistory_RequestSyntax) **   <a name="CWL-GetScheduledQueryHistory-request-endTime"></a>
The end time for the history query in Unix epoch format.  
Type: Long  
Valid Range: Minimum value of 0.  
Required: Yes

 ** [executionStatuses](#API_GetScheduledQueryHistory_RequestSyntax) **   <a name="CWL-GetScheduledQueryHistory-request-executionStatuses"></a>
An array of execution statuses to filter the history results. Only executions with the specified statuses are returned.  
Type: Array of strings  
Valid Values: `Running | InvalidQuery | Complete | Failed | Timeout`   
Required: No

 ** [identifier](#API_GetScheduledQueryHistory_RequestSyntax) **   <a name="CWL-GetScheduledQueryHistory-request-identifier"></a>
The ARN or name of the scheduled query to retrieve history for.  
Type: String  
Pattern: `[\w#+=/:,.@-]*`   
Required: Yes

 ** [maxResults](#API_GetScheduledQueryHistory_RequestSyntax) **   <a name="CWL-GetScheduledQueryHistory-request-maxResults"></a>
The maximum number of history records to return. Valid range is 1 to 1000.  
Type: Integer  
Valid Range: Minimum value of 1. Maximum value of 1000.  
Required: No

 ** [nextToken](#API_GetScheduledQueryHistory_RequestSyntax) **   <a name="CWL-GetScheduledQueryHistory-request-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.  
Required: No

 ** [startTime](#API_GetScheduledQueryHistory_RequestSyntax) **   <a name="CWL-GetScheduledQueryHistory-request-startTime"></a>
The start time for the history query in Unix epoch format.  
Type: Long  
Valid Range: Minimum value of 0.  
Required: Yes

## Response Syntax
<a name="API_GetScheduledQueryHistory_ResponseSyntax"></a>

```
{
   "name": "string",
   "nextToken": "string",
   "scheduledQueryArn": "string",
   "triggerHistory": [ 
      { 
         "destinations": [ 
            { 
               "destinationIdentifier": "string",
               "destinationType": "string",
               "errorMessage": "string",
               "processedIdentifier": "string",
               "status": "string"
            }
         ],
         "errorMessage": "string",
         "executionStatus": "string",
         "queryId": "string",
         "triggeredTimestamp": number
      }
   ]
}
```

## Response Elements
<a name="API_GetScheduledQueryHistory_ResponseElements"></a>

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

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

 ** [name](#API_GetScheduledQueryHistory_ResponseSyntax) **   <a name="CWL-GetScheduledQueryHistory-response-name"></a>
The name of the scheduled query.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 255.  
Pattern: `^[a-zA-Z0-9_\-/.#]+$` 

 ** [nextToken](#API_GetScheduledQueryHistory_ResponseSyntax) **   <a name="CWL-GetScheduledQueryHistory-response-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.

 ** [scheduledQueryArn](#API_GetScheduledQueryHistory_ResponseSyntax) **   <a name="CWL-GetScheduledQueryHistory-response-scheduledQueryArn"></a>
The ARN of the scheduled query.  
Type: String

 ** [triggerHistory](#API_GetScheduledQueryHistory_ResponseSyntax) **   <a name="CWL-GetScheduledQueryHistory-response-triggerHistory"></a>
An array of execution history records for the scheduled query.  
Type: Array of [TriggerHistoryRecord](API_TriggerHistoryRecord.md) objects

## Errors
<a name="API_GetScheduledQueryHistory_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have sufficient permissions to perform this action.  
HTTP Status Code: 400

 ** InternalServerException **   
An internal server error occurred while processing the request. This exception is returned when the service encounters an unexpected condition that prevents it from fulfilling the request.  
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The specified resource does not exist.  
HTTP Status Code: 400

 ** ThrottlingException **   
The request was throttled because of quota limits.  
HTTP Status Code: 400

 ** ValidationException **   
One of the parameters for the request is not valid.  
HTTP Status Code: 400

## See Also
<a name="API_GetScheduledQueryHistory_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/GetScheduledQueryHistory) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/GetScheduledQueryHistory) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/GetScheduledQueryHistory) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/GetScheduledQueryHistory) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/GetScheduledQueryHistory) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/GetScheduledQueryHistory) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/GetScheduledQueryHistory) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/GetScheduledQueryHistory) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/GetScheduledQueryHistory) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/GetScheduledQueryHistory) 

# GetTransformer
<a name="API_GetTransformer"></a>

Returns the information about the log transformer associated with this log group.

This operation returns data only for transformers created at the log group level. To get information for an account-level transformer, use [DescribeAccountPolicies](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeAccountPolicies.html).

## Request Syntax
<a name="API_GetTransformer_RequestSyntax"></a>

```
{
   "logGroupIdentifier": "string"
}
```

## Request Parameters
<a name="API_GetTransformer_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [logGroupIdentifier](#API_GetTransformer_RequestSyntax) **   <a name="CWL-GetTransformer-request-logGroupIdentifier"></a>
Specify either the name or ARN of the log group to return transformer information for. If the log group is in a source account and you are using a monitoring account, you must use the log group ARN.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Pattern: `[\w#+=/:,.@-]*`   
Required: Yes

## Response Syntax
<a name="API_GetTransformer_ResponseSyntax"></a>

```
{
   "creationTime": number,
   "lastModifiedTime": number,
   "logGroupIdentifier": "string",
   "transformerConfig": [ 
      { 
         "addKeys": { 
            "entries": [ 
               { 
                  "key": "string",
                  "overwriteIfExists": boolean,
                  "value": "string"
               }
            ]
         },
         "copyValue": { 
            "entries": [ 
               { 
                  "overwriteIfExists": boolean,
                  "source": "string",
                  "target": "string"
               }
            ]
         },
         "csv": { 
            "columns": [ "string" ],
            "delimiter": "string",
            "destination": "string",
            "quoteCharacter": "string",
            "source": "string"
         },
         "dateTimeConverter": { 
            "locale": "string",
            "matchPatterns": [ "string" ],
            "source": "string",
            "sourceTimezone": "string",
            "target": "string",
            "targetFormat": "string",
            "targetTimezone": "string"
         },
         "deleteKeys": { 
            "withKeys": [ "string" ]
         },
         "grok": { 
            "match": "string",
            "source": "string"
         },
         "listToMap": { 
            "flatten": boolean,
            "flattenedElement": "string",
            "key": "string",
            "source": "string",
            "target": "string",
            "valueKey": "string"
         },
         "lowerCaseString": { 
            "withKeys": [ "string" ]
         },
         "moveKeys": { 
            "entries": [ 
               { 
                  "overwriteIfExists": boolean,
                  "source": "string",
                  "target": "string"
               }
            ]
         },
         "parseCloudfront": { 
            "source": "string"
         },
         "parseJSON": { 
            "destination": "string",
            "source": "string"
         },
         "parseKeyValue": { 
            "destination": "string",
            "fieldDelimiter": "string",
            "keyPrefix": "string",
            "keyValueDelimiter": "string",
            "nonMatchValue": "string",
            "overwriteIfExists": boolean,
            "source": "string"
         },
         "parsePostgres": { 
            "source": "string"
         },
         "parseRoute53": { 
            "source": "string"
         },
         "parseToOCSF": { 
            "eventSource": "string",
            "mappingVersion": "string",
            "ocsfVersion": "string",
            "source": "string"
         },
         "parseVPC": { 
            "source": "string"
         },
         "parseWAF": { 
            "source": "string"
         },
         "renameKeys": { 
            "entries": [ 
               { 
                  "key": "string",
                  "overwriteIfExists": boolean,
                  "renameTo": "string"
               }
            ]
         },
         "splitString": { 
            "entries": [ 
               { 
                  "delimiter": "string",
                  "source": "string"
               }
            ]
         },
         "substituteString": { 
            "entries": [ 
               { 
                  "from": "string",
                  "source": "string",
                  "to": "string"
               }
            ]
         },
         "trimString": { 
            "withKeys": [ "string" ]
         },
         "typeConverter": { 
            "entries": [ 
               { 
                  "key": "string",
                  "type": "string"
               }
            ]
         },
         "upperCaseString": { 
            "withKeys": [ "string" ]
         }
      }
   ]
}
```

## Response Elements
<a name="API_GetTransformer_ResponseElements"></a>

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

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

 ** [creationTime](#API_GetTransformer_ResponseSyntax) **   <a name="CWL-GetTransformer-response-creationTime"></a>
The creation time of the transformer, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.  
Type: Long  
Valid Range: Minimum value of 0.

 ** [lastModifiedTime](#API_GetTransformer_ResponseSyntax) **   <a name="CWL-GetTransformer-response-lastModifiedTime"></a>
The date and time when this transformer was most recently modified, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.  
Type: Long  
Valid Range: Minimum value of 0.

 ** [logGroupIdentifier](#API_GetTransformer_ResponseSyntax) **   <a name="CWL-GetTransformer-response-logGroupIdentifier"></a>
The ARN of the log group that you specified in your request.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Pattern: `[\w#+=/:,.@-]*` 

 ** [transformerConfig](#API_GetTransformer_ResponseSyntax) **   <a name="CWL-GetTransformer-response-transformerConfig"></a>
This sructure contains the configuration of the requested transformer.  
Type: Array of [Processor](API_Processor.md) objects  
Array Members: Minimum number of 1 item. Maximum number of 20 items.

## Errors
<a name="API_GetTransformer_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidOperationException **   
The operation is not valid on the specified resource.  
HTTP Status Code: 400

 ** 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

## See Also
<a name="API_GetTransformer_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/GetTransformer) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/GetTransformer) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/GetTransformer) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/GetTransformer) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/GetTransformer) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/GetTransformer) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/GetTransformer) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/GetTransformer) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/GetTransformer) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/GetTransformer) 

# ListAggregateLogGroupSummaries
<a name="API_ListAggregateLogGroupSummaries"></a>

Returns an aggregate summary of all log groups in the Region grouped by specified data source characteristics. Supports optional filtering by log group class, name patterns, and data sources. If you perform this action in a monitoring account, you can also return aggregated summaries of log groups from source accounts that are linked to the monitoring account. For more information about using cross-account observability to set up monitoring accounts and source accounts, see [CloudWatch cross-account observability](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html).

The operation aggregates log groups by data source name and type and optionally format, providing counts of log groups that share these characteristics. The operation paginates results. By default, it returns up to 50 results and includes a token to retrieve more results.

## Request Syntax
<a name="API_ListAggregateLogGroupSummaries_RequestSyntax"></a>

```
{
   "accountIdentifiers": [ "string" ],
   "dataSources": [ 
      { 
         "name": "string",
         "type": "string"
      }
   ],
   "groupBy": "string",
   "includeLinkedAccounts": boolean,
   "limit": number,
   "logGroupClass": "string",
   "logGroupNamePattern": "string",
   "nextToken": "string"
}
```

## Request Parameters
<a name="API_ListAggregateLogGroupSummaries_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [accountIdentifiers](#API_ListAggregateLogGroupSummaries_RequestSyntax) **   <a name="CWL-ListAggregateLogGroupSummaries-request-accountIdentifiers"></a>
When `includeLinkedAccounts` is set to `true`, use this parameter to specify the list of accounts to search. You can specify as many as 20 account IDs in the array.  
Type: Array of strings  
Array Members: Minimum number of 0 items. Maximum number of 20 items.  
Length Constraints: Fixed length of 12.  
Pattern: `^\d{12}$`   
Required: No

 ** [dataSources](#API_ListAggregateLogGroupSummaries_RequestSyntax) **   <a name="CWL-ListAggregateLogGroupSummaries-request-dataSources"></a>
Filters the results by data source characteristics to include only log groups associated with the specified data sources.  
Type: Array of [DataSourceFilter](API_DataSourceFilter.md) objects  
Array Members: Minimum number of 1 item. Maximum number of 5 items.  
Required: No

 ** [groupBy](#API_ListAggregateLogGroupSummaries_RequestSyntax) **   <a name="CWL-ListAggregateLogGroupSummaries-request-groupBy"></a>
Specifies how to group the log groups in the summary.  
Type: String  
Valid Values: `DATA_SOURCE_NAME_TYPE_AND_FORMAT | DATA_SOURCE_NAME_AND_TYPE`   
Required: Yes

 ** [includeLinkedAccounts](#API_ListAggregateLogGroupSummaries_RequestSyntax) **   <a name="CWL-ListAggregateLogGroupSummaries-request-includeLinkedAccounts"></a>
If you are using a monitoring account, set this to `true` to have the operation return log groups in the accounts listed in `accountIdentifiers`.  
If this parameter is set to `true` and `accountIdentifiers` contains a null value, the operation returns all log groups in the monitoring account and all log groups in all source accounts that are linked to the monitoring account.   
The default for this parameter is `false`.  
Type: Boolean  
Required: No

 ** [limit](#API_ListAggregateLogGroupSummaries_RequestSyntax) **   <a name="CWL-ListAggregateLogGroupSummaries-request-limit"></a>
The maximum number of aggregated summaries to return. If you omit this parameter, the default is up to 50 aggregated summaries.  
Type: Integer  
Valid Range: Minimum value of 1. Maximum value of 50.  
Required: No

 ** [logGroupClass](#API_ListAggregateLogGroupSummaries_RequestSyntax) **   <a name="CWL-ListAggregateLogGroupSummaries-request-logGroupClass"></a>
Filters the results by log group class to include only log groups of the specified class.  
Type: String  
Valid Values: `STANDARD | INFREQUENT_ACCESS | DELIVERY`   
Required: No

 ** [logGroupNamePattern](#API_ListAggregateLogGroupSummaries_RequestSyntax) **   <a name="CWL-ListAggregateLogGroupSummaries-request-logGroupNamePattern"></a>
Use this parameter to limit the returned log groups to only those with names that match the pattern that you specify. This parameter is a regular expression that can match prefixes and substrings, and supports wildcard matching and matching multiple patterns, as in the following examples.   
+ Use `^` to match log group names by prefix.
+ For a substring match, specify the string to match. All matches are case sensitive
+ To match multiple patterns, separate them with a `|` as in the example `^/aws/lambda|discovery` 
You can specify as many as five different regular expression patterns in this field, each of which must be between 3 and 24 characters. You can include the `^` symbol as many as five times, and include the `|` symbol as many as four times.  
Type: String  
Length Constraints: Minimum length of 3. Maximum length of 129.  
Pattern: `(\^?[\.\-_\/#A-Za-z0-9]{3,24})(\|\^?[\.\-_\/#A-Za-z0-9]{3,24}){0,4}`   
Required: No

 ** [nextToken](#API_ListAggregateLogGroupSummaries_RequestSyntax) **   <a name="CWL-ListAggregateLogGroupSummaries-request-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.  
Required: No

## Response Syntax
<a name="API_ListAggregateLogGroupSummaries_ResponseSyntax"></a>

```
{
   "aggregateLogGroupSummaries": [ 
      { 
         "groupingIdentifiers": [ 
            { 
               "key": "string",
               "value": "string"
            }
         ],
         "logGroupCount": number
      }
   ],
   "nextToken": "string"
}
```

## Response Elements
<a name="API_ListAggregateLogGroupSummaries_ResponseElements"></a>

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

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

 ** [aggregateLogGroupSummaries](#API_ListAggregateLogGroupSummaries_ResponseSyntax) **   <a name="CWL-ListAggregateLogGroupSummaries-response-aggregateLogGroupSummaries"></a>
The list of aggregate log group summaries grouped by the specified data source characteristics.  
Type: Array of [AggregateLogGroupSummary](API_AggregateLogGroupSummary.md) objects

 ** [nextToken](#API_ListAggregateLogGroupSummaries_ResponseSyntax) **   <a name="CWL-ListAggregateLogGroupSummaries-response-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.

## Errors
<a name="API_ListAggregateLogGroupSummaries_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** ServiceUnavailableException **   
The service cannot complete the request.  
HTTP Status Code: 500

 ** ValidationException **   
One of the parameters for the request is not valid.  
HTTP Status Code: 400

## See Also
<a name="API_ListAggregateLogGroupSummaries_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/ListAggregateLogGroupSummaries) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/ListAggregateLogGroupSummaries) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/ListAggregateLogGroupSummaries) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/ListAggregateLogGroupSummaries) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/ListAggregateLogGroupSummaries) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/ListAggregateLogGroupSummaries) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/ListAggregateLogGroupSummaries) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/ListAggregateLogGroupSummaries) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/ListAggregateLogGroupSummaries) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/ListAggregateLogGroupSummaries) 

# ListAnomalies
<a name="API_ListAnomalies"></a>

Returns a list of anomalies that log anomaly detectors have found. For details about the structure format of each anomaly object that is returned, see the example in this section.

## Request Syntax
<a name="API_ListAnomalies_RequestSyntax"></a>

```
{
   "anomalyDetectorArn": "string",
   "limit": number,
   "nextToken": "string",
   "suppressionState": "string"
}
```

## Request Parameters
<a name="API_ListAnomalies_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [anomalyDetectorArn](#API_ListAnomalies_RequestSyntax) **   <a name="CWL-ListAnomalies-request-anomalyDetectorArn"></a>
Use this to optionally limit the results to only the anomalies found by a certain anomaly detector.  
Type: String  
Length Constraints: Minimum length of 1.  
Pattern: `[\w#+=/:,.@-]*`   
Required: No

 ** [limit](#API_ListAnomalies_RequestSyntax) **   <a name="CWL-ListAnomalies-request-limit"></a>
The maximum number of items to return. If you don't specify a value, the default maximum value of 50 items is used.  
Type: Integer  
Valid Range: Minimum value of 1. Maximum value of 50.  
Required: No

 ** [nextToken](#API_ListAnomalies_RequestSyntax) **   <a name="CWL-ListAnomalies-request-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.  
Required: No

 ** [suppressionState](#API_ListAnomalies_RequestSyntax) **   <a name="CWL-ListAnomalies-request-suppressionState"></a>
You can specify this parameter if you want to the operation to return only anomalies that are currently either suppressed or unsuppressed.  
Type: String  
Valid Values: `SUPPRESSED | UNSUPPRESSED`   
Required: No

## Response Syntax
<a name="API_ListAnomalies_ResponseSyntax"></a>

```
{
   "anomalies": [ 
      { 
         "active": boolean,
         "anomalyDetectorArn": "string",
         "anomalyId": "string",
         "description": "string",
         "firstSeen": number,
         "histogram": { 
            "string" : number 
         },
         "isPatternLevelSuppression": boolean,
         "lastSeen": number,
         "logGroupArnList": [ "string" ],
         "logSamples": [ 
            { 
               "message": "string",
               "timestamp": number
            }
         ],
         "patternId": "string",
         "patternRegex": "string",
         "patternString": "string",
         "patternTokens": [ 
            { 
               "dynamicTokenPosition": number,
               "enumerations": { 
                  "string" : number 
               },
               "inferredTokenName": "string",
               "isDynamic": boolean,
               "tokenString": "string"
            }
         ],
         "priority": "string",
         "state": "string",
         "suppressed": boolean,
         "suppressedDate": number,
         "suppressedUntil": number
      }
   ],
   "nextToken": "string"
}
```

## Response Elements
<a name="API_ListAnomalies_ResponseElements"></a>

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

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

 ** [anomalies](#API_ListAnomalies_ResponseSyntax) **   <a name="CWL-ListAnomalies-response-anomalies"></a>
An array of structures, where each structure contains information about one anomaly that a log anomaly detector has found.  
Type: Array of [Anomaly](API_Anomaly.md) objects

 ** [nextToken](#API_ListAnomalies_ResponseSyntax) **   <a name="CWL-ListAnomalies-response-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.

## Errors
<a name="API_ListAnomalies_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
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
<a name="API_ListAnomalies_Examples"></a>

### To retrieve a list of anomalies found by logs anomaly detectors
<a name="API_ListAnomalies_Example_1"></a>

This example illustrates one usage of ListAnomalies.

#### Sample Request
<a name="API_ListAnomalies_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.ListAnomalies
{
   "anomalyDetectorArn": "arn:aws:logs:us-west-1:123456789012:anomaly-detector:EXAMPLE-1234-5678-abcd-111111111111",
   "limit": 50,
}
```

#### Sample Response
<a name="API_ListAnomalies_Example_1_Response"></a>

```
{
    "anomalies": [
        {
            "active": false,
            "anomalyDetectorArn": "arn:aws:logs:us-west-1:123456789012:anomaly-detector:EXAMPLE-1234-5678-abcd-111111111111",
            "anomalyId": "EXAMPLE-529d-4e1e-bea9-123EXAMPLE",
            "description": "Count of ErrorCode: 200 at token: 9 deviated expected by: 20.00%",
            "firstSeen": 1698488280000,
            "histogram": {
                "1698487995000": 2,
                "1698488285000": 4,
                "1698488295000": 1,
                "1698488300000": 1,
                "1698488305000": 4
            },
            "isPatternLevelSuppression": false,
            "lastSeen": 1698488580000,
            "logGroupArnList": [
                "arn:aws:logs:us-east-1:123456789012:log-group:/aws/lambda/my-log-group-name"
            ],
            "logSamples": [
                {
                    "message": "2023-10-28T10:18:18.959Z\EXAMPLE-4e26-41d8-8b54-EXAMPLE\tINFO\tResponse: 200 https://global.console.aws.amazon.com/EXAMPLEURL",
                    "timestamp": 1698488298959
                }
            ],
            "patternId": "EXAMPLE86827f77073836412345678",
            "patternRegex": ".*\\Q\t\\E.*\\Q\tINFO\tResponse: \\E.*\\Q https:\\E.*\\Q=\\E.*\\Q=\\E.*\\Q=\\E.*\\Q\n\\E",
            "patternString": "<*>\t<*>\tINFO\tResponse: <*> https:<*>=<*>=<*>=<*>\n",
            "patternTokens": [
                {
                    "dynamicTokenPosition": 1,
                    "enumerations": {
                        "2023-10-28T10:18:08.420Z": 2,
                        "2023-10-28T10:18:18.959Z": 1,
                        "2023-10-28T10:18:20.260Z": 1,
                        "2023-10-28T10:18:25.440Z": 1,
                        "2023-10-28T10:18:27.508Z": 1
                    },
                    "isDynamic": true,
                    "tokenString": "<*>"
                },
                {
                    "dynamicTokenPosition": 0,
                    "enumerations": {},
                    "isDynamic": false,
                    "tokenString": "\t"
                },
                {
                    "dynamicTokenPosition": 2,
                    "enumerations": {
                        "4766bcdd-4e26-41d8-8b54-fa0ae43f6201": 6
                    },
                    "isDynamic": true,
                    "tokenString": "<*>"
                },
                {
                    "dynamicTokenPosition": 0,
                    "enumerations": {},
                    "isDynamic": false,
                    "tokenString": "\t"
                },
                {
                    "dynamicTokenPosition": 0,
                    "enumerations": {},
                    "isDynamic": false,
                    "tokenString": "INFO"
                },
                {
                    "dynamicTokenPosition": 0,
                    "enumerations": {},
                    "isDynamic": false,
                    "tokenString": "\t"
                },
                {
                    "dynamicTokenPosition": 0,
                    "enumerations": {},
                    "isDynamic": false,
                    "tokenString": "Response"
                },
                {
                    "dynamicTokenPosition": 0,
                    "enumerations": {},
                    "isDynamic": false,
                    "tokenString": ":"
                },
                {
                    "dynamicTokenPosition": 0,
                    "enumerations": {},
                    "isDynamic": false,
                    "tokenString": " "
                },
                {
                    "dynamicTokenPosition": 3,
                    "enumerations": {
                        "200": 6
                    },
                    "isDynamic": true,
                    "tokenString": "<*>"
                },
                {
                    "dynamicTokenPosition": 0,
                    "enumerations": {},
                    "isDynamic": false,
                    "tokenString": " "
                },
                {
                    "dynamicTokenPosition": 0,
                    "enumerations": {},
                    "isDynamic": false,
                    "tokenString": "https"
                },
                {
                    "dynamicTokenPosition": 0,
                    "enumerations": {},
                    "isDynamic": false,
                    "tokenString": ":"
                },
                {
                    "dynamicTokenPosition": 4,
                    "enumerations": {
                        "//global.console.aws.amazon.com/EXAMPLEURL": 1,
                        "//prod.EXAMPLEURL2": 5
                    },
                    "isDynamic": true,
                    "tokenString": "<*>"
                },
                {
                    "dynamicTokenPosition": 0,
                    "enumerations": {},
                    "isDynamic": false,
                    "tokenString": "="
                },
                {
                    "dynamicTokenPosition": 5,
                    "enumerations": {
                        "%40amzn%2Faws-ccx-regions-availability&majorVersion": 1,
                        "info&message": 5
                    },
                    "isDynamic": true,
                    "tokenString": "<*>"
                },
                {
                    "dynamicTokenPosition": 0,
                    "enumerations": {},
                    "isDynamic": false,
                    "tokenString": "="
                },
                {
                    "dynamicTokenPosition": 6,
                    "enumerations": {
                        "1&versionId": 1,
                        "checkForCookieConsent&payload": 3,
                        "geolocationLatency&payload": 1,
                        "uiMounted&payload": 1
                    },
                    "isDynamic": true,
                    "tokenString": "<*>"
                },
                {
                    "dynamicTokenPosition": 0,
                    "enumerations": {},
                    "isDynamic": false,
                    "tokenString": "="
                },
               {
                    "dynamicTokenPosition": 0,
                    "enumerations": {},
                    "isDynamic": false,
                    "tokenString": "\n"
                }
            ],
            "priority": "LOW",
            "state": "Active",
            "suppressed": false,
            "suppressedDate": 0,
            "suppressedUntil": 0
        },
        {
            "active": false,
            "anomalyDetectorArn": "arn:aws:logs:us-west-1:123456789012:anomaly-detector:EXAMPLE-1234-5678-abcd-111111111111",
            "anomalyId": "EXAMPLE-09d4-4286-9cd3-EXAMPLE",
            "description": "Count of ErrorCode: 200 at token: 9 deviated expected by: 95.12%",
            "firstSeen": 1698392040000,
            "histogram": {
                "1698392035000": 17,
                "1698392040000": 5
            },
            "isPatternLevelSuppression": true,
            "lastSeen": 1698392340000,
            "logGroupArnList": [
                "arn:aws:logs:us-east-1:123456789012:log-group:another-log-group"
            ],
            "logSamples": [
                {
                    "message": "2023-10-27T07:33:56.178Z\tb3c81837-ead3-46ac-9334-68fa05453033\tINFO\tResponse: 200 https://EXAMPLE-URL-2",
                    "timestamp": 1698392036178
                }
            ],
            "patternId": "9f2e9e2844e41728651fb229351c90e0",
            "patternRegex": ".*\\Q\t\\E.*\\Q\tINFO\tResponse: \\E.*\\Q https:\\E.*\\Q\n\\E",
            "patternString": "<*>\t<*>\tINFO\tResponse: <*> https:<*>\n",
            "patternTokens": [
                {
                    "dynamicTokenPosition": 1,
                    "enumerations": {
                        "2023-10-27T07:33:56.238Z": 1,
                        "2023-10-27T07:33:56.253Z": 1,
                        "2023-10-27T07:33:56.274Z": 1,
                        "2023-10-27T07:33:56.295Z": 1,
                        "2023-10-27T07:34:01.929Z": 1
                    },
                    "isDynamic": true,
                    "tokenString": "<*>"
                },
                {
                    "dynamicTokenPosition": 0,
                    "enumerations": {},
                    "isDynamic": false,
                    "tokenString": "\t"
                },
                {
                    "dynamicTokenPosition": 2,
                    "enumerations": {
                        "b3c81837-ead3-46ac-9334-68fa05453033": 22
                    },
                    "isDynamic": true,
                    "tokenString": "<*>"
                },
                {
                    "dynamicTokenPosition": 0,
                    "enumerations": {},
                    "isDynamic": false,
                    "tokenString": "\t"
                },
                {
                    "dynamicTokenPosition": 0,
                    "enumerations": {},
                    "isDynamic": false,
                    "tokenString": "INFO"
                },
                {
                    "dynamicTokenPosition": 0,
                    "enumerations": {},
                    "isDynamic": false,
                    "tokenString": "\t"
                },
                {
                    "dynamicTokenPosition": 0,
                    "enumerations": {},
                    "isDynamic": false,
                    "tokenString": "Response"
                },
                {
                    "dynamicTokenPosition": 0,
                    "enumerations": {},
                    "isDynamic": false,
                    "tokenString": ":"
                },
                {
                    "dynamicTokenPosition": 0,
                    "enumerations": {},
                    "isDynamic": false,
                    "tokenString": " "
                },
                {
                    "dynamicTokenPosition": 3,
                    "enumerations": {
                        "200": 22
                    },
                    "isDynamic": true,
                    "tokenString": "<*>"
                },
                {
                    "dynamicTokenPosition": 0,
                    "enumerations": {},
                    "isDynamic": false,
                    "tokenString": " "
                },
                {
                    "dynamicTokenPosition": 0,
                    "enumerations": {},
                    "isDynamic": false,
                    "tokenString": "https"
                },
                {
                    "dynamicTokenPosition": 0,
                    "enumerations": {},
                    "isDynamic": false,
                    "tokenString": ":"
                },
                {
                    "dynamicTokenPosition": 4,
                    "enumerations": {
                        "//EXAMPLE-URL-1": 12,
                        "//EXAMPLE-URL-2": 1,
                        "//EXAMPLE-URL-2": 6,
                        "//EXAMPLE-URL-3": 3
                    },
                    "isDynamic": true,
                    "tokenString": "<*>"
                },
                {
                    "dynamicTokenPosition": 0,
                    "enumerations": {},
                    "isDynamic": false,
                    "tokenString": "\n"
                }
            ],
            "priority": "LOW",
            "state": "Active",
            "suppressed": true,
            "suppressedDate": 0,
            "suppressedUntil": 1702393208766
        },
```

## See Also
<a name="API_ListAnomalies_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/ListAnomalies) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/ListAnomalies) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/ListAnomalies) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/ListAnomalies) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/ListAnomalies) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/ListAnomalies) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/ListAnomalies) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/ListAnomalies) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/ListAnomalies) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/ListAnomalies) 

# ListIntegrations
<a name="API_ListIntegrations"></a>

Returns a list of integrations between CloudWatch Logs and other services in this account. Currently, only one integration can be created in an account, and this integration must be with OpenSearch Service.

## Request Syntax
<a name="API_ListIntegrations_RequestSyntax"></a>

```
{
   "integrationNamePrefix": "string",
   "integrationStatus": "string",
   "integrationType": "string"
}
```

## Request Parameters
<a name="API_ListIntegrations_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [integrationNamePrefix](#API_ListIntegrations_RequestSyntax) **   <a name="CWL-ListIntegrations-request-integrationNamePrefix"></a>
To limit the results to integrations that start with a certain name prefix, specify that name prefix here.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 50.  
Pattern: `[\.\-_/#A-Za-z0-9]+`   
Required: No

 ** [integrationStatus](#API_ListIntegrations_RequestSyntax) **   <a name="CWL-ListIntegrations-request-integrationStatus"></a>
To limit the results to integrations with a certain status, specify that status here.  
Type: String  
Valid Values: `PROVISIONING | ACTIVE | FAILED`   
Required: No

 ** [integrationType](#API_ListIntegrations_RequestSyntax) **   <a name="CWL-ListIntegrations-request-integrationType"></a>
To limit the results to integrations of a certain type, specify that type here.  
Type: String  
Valid Values: `OPENSEARCH`   
Required: No

## Response Syntax
<a name="API_ListIntegrations_ResponseSyntax"></a>

```
{
   "integrationSummaries": [ 
      { 
         "integrationName": "string",
         "integrationStatus": "string",
         "integrationType": "string"
      }
   ]
}
```

## Response Elements
<a name="API_ListIntegrations_ResponseElements"></a>

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

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

 ** [integrationSummaries](#API_ListIntegrations_ResponseSyntax) **   <a name="CWL-ListIntegrations-response-integrationSummaries"></a>
An array, where each object in the array contains information about one CloudWatch Logs integration in this account.   
Type: Array of [IntegrationSummary](API_IntegrationSummary.md) objects

## Errors
<a name="API_ListIntegrations_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** ServiceUnavailableException **   
The service cannot complete the request.  
HTTP Status Code: 500

## See Also
<a name="API_ListIntegrations_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/ListIntegrations) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/ListIntegrations) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/ListIntegrations) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/ListIntegrations) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/ListIntegrations) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/ListIntegrations) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/ListIntegrations) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/ListIntegrations) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/ListIntegrations) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/ListIntegrations) 

# ListLogAnomalyDetectors
<a name="API_ListLogAnomalyDetectors"></a>

Retrieves a list of the log anomaly detectors in the account.

## Request Syntax
<a name="API_ListLogAnomalyDetectors_RequestSyntax"></a>

```
{
   "filterLogGroupArn": "string",
   "limit": number,
   "nextToken": "string"
}
```

## Request Parameters
<a name="API_ListLogAnomalyDetectors_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [filterLogGroupArn](#API_ListLogAnomalyDetectors_RequestSyntax) **   <a name="CWL-ListLogAnomalyDetectors-request-filterLogGroupArn"></a>
Use this to optionally filter the results to only include anomaly detectors that are associated with the specified log group.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Pattern: `[\w#+=/:,.@-]*`   
Required: No

 ** [limit](#API_ListLogAnomalyDetectors_RequestSyntax) **   <a name="CWL-ListLogAnomalyDetectors-request-limit"></a>
The maximum number of items to return. If you don't specify a value, the default maximum value of 50 items is used.  
Type: Integer  
Valid Range: Minimum value of 1. Maximum value of 50.  
Required: No

 ** [nextToken](#API_ListLogAnomalyDetectors_RequestSyntax) **   <a name="CWL-ListLogAnomalyDetectors-request-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.  
Required: No

## Response Syntax
<a name="API_ListLogAnomalyDetectors_ResponseSyntax"></a>

```
{
   "anomalyDetectors": [ 
      { 
         "anomalyDetectorArn": "string",
         "anomalyDetectorStatus": "string",
         "anomalyVisibilityTime": number,
         "creationTimeStamp": number,
         "detectorName": "string",
         "evaluationFrequency": "string",
         "filterPattern": "string",
         "kmsKeyId": "string",
         "lastModifiedTimeStamp": number,
         "logGroupArnList": [ "string" ]
      }
   ],
   "nextToken": "string"
}
```

## Response Elements
<a name="API_ListLogAnomalyDetectors_ResponseElements"></a>

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

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

 ** [anomalyDetectors](#API_ListLogAnomalyDetectors_ResponseSyntax) **   <a name="CWL-ListLogAnomalyDetectors-response-anomalyDetectors"></a>
An array of structures, where each structure in the array contains information about one anomaly detector.  
Type: Array of [AnomalyDetector](API_AnomalyDetector.md) objects

 ** [nextToken](#API_ListLogAnomalyDetectors_ResponseSyntax) **   <a name="CWL-ListLogAnomalyDetectors-response-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.

## Errors
<a name="API_ListLogAnomalyDetectors_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
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

## See Also
<a name="API_ListLogAnomalyDetectors_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/ListLogAnomalyDetectors) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/ListLogAnomalyDetectors) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/ListLogAnomalyDetectors) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/ListLogAnomalyDetectors) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/ListLogAnomalyDetectors) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/ListLogAnomalyDetectors) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/ListLogAnomalyDetectors) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/ListLogAnomalyDetectors) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/ListLogAnomalyDetectors) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/ListLogAnomalyDetectors) 

# ListLogGroups
<a name="API_ListLogGroups"></a>

Returns a list of log groups in the Region in your account. If you are performing this action in a monitoring account, you can choose to also return log groups from source accounts that are linked to the monitoring account. For more information about using cross-account observability to set up monitoring accounts and source accounts, see [ CloudWatch cross-account observability](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html).

You can optionally filter the list by log group class, by using regular expressions in your request to match strings in the log group names, by using the fieldIndexes parameter to filter log groups based on which field indexes are configured, by using the dataSources parameter to filter log groups by data source types, and by using the fieldIndexNames parameter to filter by specific field index names.

This operation is paginated. By default, your first use of this operation returns 50 results, and includes a token to use in a subsequent operation to return more results.

## Request Syntax
<a name="API_ListLogGroups_RequestSyntax"></a>

```
{
   "accountIdentifiers": [ "string" ],
   "dataSources": [ 
      { 
         "name": "string",
         "type": "string"
      }
   ],
   "fieldIndexNames": [ "string" ],
   "includeLinkedAccounts": boolean,
   "limit": number,
   "logGroupClass": "string",
   "logGroupNamePattern": "string",
   "nextToken": "string"
}
```

## Request Parameters
<a name="API_ListLogGroups_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [accountIdentifiers](#API_ListLogGroups_RequestSyntax) **   <a name="CWL-ListLogGroups-request-accountIdentifiers"></a>
When `includeLinkedAccounts` is set to `true`, use this parameter to specify the list of accounts to search. You can specify as many as 20 account IDs in the array.  
Type: Array of strings  
Array Members: Minimum number of 0 items. Maximum number of 20 items.  
Length Constraints: Fixed length of 12.  
Pattern: `^\d{12}$`   
Required: No

 ** [dataSources](#API_ListLogGroups_RequestSyntax) **   <a name="CWL-ListLogGroups-request-dataSources"></a>
An array of data source filters to filter log groups by their associated data sources. You can filter by data source name, type, or both. Multiple filters within the same dimension are combined with OR logic, while filters across different dimensions are combined with AND logic.  
Type: Array of [DataSourceFilter](API_DataSourceFilter.md) objects  
Array Members: Minimum number of 1 item. Maximum number of 5 items.  
Required: No

 ** [fieldIndexNames](#API_ListLogGroups_RequestSyntax) **   <a name="CWL-ListLogGroups-request-fieldIndexNames"></a>
An array of field index names to filter log groups that have specific field indexes. Only log groups containing all specified field indexes are returned. You can specify 1 to 20 field index names, each with 1 to 512 characters.  
Type: Array of strings  
Array Members: Minimum number of 1 item. Maximum number of 20 items.  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[\.\-_/#A-Za-z0-9]+`   
Required: No

 ** [includeLinkedAccounts](#API_ListLogGroups_RequestSyntax) **   <a name="CWL-ListLogGroups-request-includeLinkedAccounts"></a>
If you are using a monitoring account, set this to `true` to have the operation return log groups in the accounts listed in `accountIdentifiers`.  
If this parameter is set to `true` and `accountIdentifiers` contains a null value, the operation returns all log groups in the monitoring account and all log groups in all source accounts that are linked to the monitoring account.   
The default for this parameter is `false`.  
Type: Boolean  
Required: No

 ** [limit](#API_ListLogGroups_RequestSyntax) **   <a name="CWL-ListLogGroups-request-limit"></a>
The maximum number of log groups to return. If you omit this parameter, the default is up to 50 log groups.  
Type: Integer  
Valid Range: Minimum value of 1. Maximum value of 1000.  
Required: No

 ** [logGroupClass](#API_ListLogGroups_RequestSyntax) **   <a name="CWL-ListLogGroups-request-logGroupClass"></a>
Use this parameter to limit the results to only those log groups in the specified log group class. If you omit this parameter, log groups of all classes can be returned.  
Type: String  
Valid Values: `STANDARD | INFREQUENT_ACCESS | DELIVERY`   
Required: No

 ** [logGroupNamePattern](#API_ListLogGroups_RequestSyntax) **   <a name="CWL-ListLogGroups-request-logGroupNamePattern"></a>
Use this parameter to limit the returned log groups to only those with names that match the pattern that you specify. This parameter is a regular expression that can match prefixes and substrings, and supports wildcard matching and matching multiple patterns, as in the following examples.   
+ Use `^` to match log group names by prefix.
+ For a substring match, specify the string to match. All matches are case sensitive
+ To match multiple patterns, separate them with a `|` as in the example `^/aws/lambda|discovery` 
You can specify as many as five different regular expression patterns in this field, each of which must be between 3 and 24 characters. You can include the `^` symbol as many as five times, and include the `|` symbol as many as four times.  
Type: String  
Length Constraints: Minimum length of 3. Maximum length of 129.  
Pattern: `(\^?[\.\-_\/#A-Za-z0-9]{3,24})(\|\^?[\.\-_\/#A-Za-z0-9]{3,24}){0,4}`   
Required: No

 ** [nextToken](#API_ListLogGroups_RequestSyntax) **   <a name="CWL-ListLogGroups-request-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.  
Required: No

## Response Syntax
<a name="API_ListLogGroups_ResponseSyntax"></a>

```
{
   "logGroups": [ 
      { 
         "logGroupArn": "string",
         "logGroupClass": "string",
         "logGroupName": "string"
      }
   ],
   "nextToken": "string"
}
```

## Response Elements
<a name="API_ListLogGroups_ResponseElements"></a>

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

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

 ** [logGroups](#API_ListLogGroups_ResponseSyntax) **   <a name="CWL-ListLogGroups-response-logGroups"></a>
An array of structures, where each structure contains the information about one log group.  
Type: Array of [LogGroupSummary](API_LogGroupSummary.md) objects

 ** [nextToken](#API_ListLogGroups_ResponseSyntax) **   <a name="CWL-ListLogGroups-response-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.

## Errors
<a name="API_ListLogGroups_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** ServiceUnavailableException **   
The service cannot complete the request.  
HTTP Status Code: 500

## See Also
<a name="API_ListLogGroups_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/ListLogGroups) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/ListLogGroups) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/ListLogGroups) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/ListLogGroups) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/ListLogGroups) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/ListLogGroups) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/ListLogGroups) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/ListLogGroups) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/ListLogGroups) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/ListLogGroups) 

# ListLogGroupsForQuery
<a name="API_ListLogGroupsForQuery"></a>

Returns a list of the log groups that were analyzed during a single CloudWatch Logs Insights query. This can be useful for queries that use log group name prefixes or the `filterIndex` command, because the log groups are dynamically selected in these cases.

For more information about field indexes, see [Create field indexes to improve query performance and reduce costs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatchLogs-Field-Indexing.html).

## Request Syntax
<a name="API_ListLogGroupsForQuery_RequestSyntax"></a>

```
{
   "maxResults": number,
   "nextToken": "string",
   "queryId": "string"
}
```

## Request Parameters
<a name="API_ListLogGroupsForQuery_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [maxResults](#API_ListLogGroupsForQuery_RequestSyntax) **   <a name="CWL-ListLogGroupsForQuery-request-maxResults"></a>
Limits the number of returned log groups to the specified number.  
Type: Integer  
Valid Range: Minimum value of 50. Maximum value of 500.  
Required: No

 ** [nextToken](#API_ListLogGroupsForQuery_RequestSyntax) **   <a name="CWL-ListLogGroupsForQuery-request-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.  
Required: No

 ** [queryId](#API_ListLogGroupsForQuery_RequestSyntax) **   <a name="CWL-ListLogGroupsForQuery-request-queryId"></a>
The ID of the query to use. This query ID is from the response to your [StartQuery](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_StartQuery.html) operation.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 256.  
Required: Yes

## Response Syntax
<a name="API_ListLogGroupsForQuery_ResponseSyntax"></a>

```
{
   "logGroupIdentifiers": [ "string" ],
   "nextToken": "string"
}
```

## Response Elements
<a name="API_ListLogGroupsForQuery_ResponseElements"></a>

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

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

 ** [logGroupIdentifiers](#API_ListLogGroupsForQuery_ResponseSyntax) **   <a name="CWL-ListLogGroupsForQuery-response-logGroupIdentifiers"></a>
An array of the names and ARNs of the log groups that were processed in the query.  
Type: Array of strings  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Pattern: `[\w#+=/:,.@-]*` 

 ** [nextToken](#API_ListLogGroupsForQuery_ResponseSyntax) **   <a name="CWL-ListLogGroupsForQuery-response-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.

## Errors
<a name="API_ListLogGroupsForQuery_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have sufficient permissions to perform this action.  
HTTP Status Code: 400

 ** 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
<a name="API_ListLogGroupsForQuery_Examples"></a>

### To list the log groups that were analyzed during a specific query
<a name="API_ListLogGroupsForQuery_Example_1"></a>

The following examplereturns the log groups that were analyzed during the query with the `71bacb5a-30f1-4ed6-9959-2797EXAMPLE` ID.

#### Sample Request
<a name="API_ListLogGroupsForQuery_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.ListLogGroupsForQuery
{
  "queryId": "71bacb5a-30f1-4ed6-9959-2797EXAMPLE"
}
```

#### Sample Response
<a name="API_ListLogGroupsForQuery_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
  "logGroupIdentifiers": [
    "arn:aws:logs:us-east-1:112233445566:log-group:/aws/lambda/applogs",
    "arn:aws:logs:us-east-1:112233445566:log-group:/aws/lambda/servicelogs",
    "arn:aws:logs:us-east-1:112233445566:log-group:/aws/lambda/errorlogs"
  ]
}
```

## See Also
<a name="API_ListLogGroupsForQuery_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/ListLogGroupsForQuery) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/ListLogGroupsForQuery) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/ListLogGroupsForQuery) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/ListLogGroupsForQuery) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/ListLogGroupsForQuery) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/ListLogGroupsForQuery) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/ListLogGroupsForQuery) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/ListLogGroupsForQuery) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/ListLogGroupsForQuery) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/ListLogGroupsForQuery) 

# ListScheduledQueries
<a name="API_ListScheduledQueries"></a>

Lists all scheduled queries in your account and region. You can filter results by state to show only enabled or disabled queries.

## Request Syntax
<a name="API_ListScheduledQueries_RequestSyntax"></a>

```
{
   "maxResults": number,
   "nextToken": "string",
   "state": "string"
}
```

## Request Parameters
<a name="API_ListScheduledQueries_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [maxResults](#API_ListScheduledQueries_RequestSyntax) **   <a name="CWL-ListScheduledQueries-request-maxResults"></a>
The maximum number of scheduled queries to return. Valid range is 1 to 1000.  
Type: Integer  
Valid Range: Minimum value of 1. Maximum value of 1000.  
Required: No

 ** [nextToken](#API_ListScheduledQueries_RequestSyntax) **   <a name="CWL-ListScheduledQueries-request-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.  
Required: No

 ** [state](#API_ListScheduledQueries_RequestSyntax) **   <a name="CWL-ListScheduledQueries-request-state"></a>
Filter scheduled queries by state. Valid values are `ENABLED` and `DISABLED`. If not specified, all scheduled queries are returned.  
Type: String  
Valid Values: `ENABLED | DISABLED`   
Required: No

## Response Syntax
<a name="API_ListScheduledQueries_ResponseSyntax"></a>

```
{
   "nextToken": "string",
   "scheduledQueries": [ 
      { 
         "creationTime": number,
         "destinationConfiguration": { 
            "s3Configuration": { 
               "destinationIdentifier": "string",
               "kmsKeyId": "string",
               "ownerAccountId": "string",
               "roleArn": "string"
            }
         },
         "lastExecutionStatus": "string",
         "lastTriggeredTime": number,
         "lastUpdatedTime": number,
         "name": "string",
         "scheduledQueryArn": "string",
         "scheduleExpression": "string",
         "state": "string",
         "timezone": "string"
      }
   ]
}
```

## Response Elements
<a name="API_ListScheduledQueries_ResponseElements"></a>

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

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

 ** [nextToken](#API_ListScheduledQueries_ResponseSyntax) **   <a name="CWL-ListScheduledQueries-response-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.

 ** [scheduledQueries](#API_ListScheduledQueries_ResponseSyntax) **   <a name="CWL-ListScheduledQueries-response-scheduledQueries"></a>
An array of scheduled query summary information.  
Type: Array of [ScheduledQuerySummary](API_ScheduledQuerySummary.md) objects

## Errors
<a name="API_ListScheduledQueries_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have sufficient permissions to perform this action.  
HTTP Status Code: 400

 ** InternalServerException **   
An internal server error occurred while processing the request. This exception is returned when the service encounters an unexpected condition that prevents it from fulfilling the request.  
HTTP Status Code: 500

 ** ThrottlingException **   
The request was throttled because of quota limits.  
HTTP Status Code: 400

 ** ValidationException **   
One of the parameters for the request is not valid.  
HTTP Status Code: 400

## See Also
<a name="API_ListScheduledQueries_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/ListScheduledQueries) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/ListScheduledQueries) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/ListScheduledQueries) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/ListScheduledQueries) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/ListScheduledQueries) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/ListScheduledQueries) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/ListScheduledQueries) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/ListScheduledQueries) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/ListScheduledQueries) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/ListScheduledQueries) 

# ListSourcesForS3TableIntegration
<a name="API_ListSourcesForS3TableIntegration"></a>

Returns a list of data source associations for a specified S3 Table Integration, showing which data sources are currently associated for query access.

## Request Syntax
<a name="API_ListSourcesForS3TableIntegration_RequestSyntax"></a>

```
{
   "integrationArn": "string",
   "maxResults": number,
   "nextToken": "string"
}
```

## Request Parameters
<a name="API_ListSourcesForS3TableIntegration_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [integrationArn](#API_ListSourcesForS3TableIntegration_RequestSyntax) **   <a name="CWL-ListSourcesForS3TableIntegration-request-integrationArn"></a>
The Amazon Resource Name (ARN) of the S3 Table Integration to list associations for.  
Type: String  
Required: Yes

 ** [maxResults](#API_ListSourcesForS3TableIntegration_RequestSyntax) **   <a name="CWL-ListSourcesForS3TableIntegration-request-maxResults"></a>
The maximum number of associations to return in a single call. Valid range is 1 to 100.  
Type: Integer  
Valid Range: Minimum value of 1. Maximum value of 100.  
Required: No

 ** [nextToken](#API_ListSourcesForS3TableIntegration_RequestSyntax) **   <a name="CWL-ListSourcesForS3TableIntegration-request-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.  
Required: No

## Response Syntax
<a name="API_ListSourcesForS3TableIntegration_ResponseSyntax"></a>

```
{
   "nextToken": "string",
   "sources": [ 
      { 
         "createdTimeStamp": number,
         "dataSource": { 
            "name": "string",
            "type": "string"
         },
         "identifier": "string",
         "status": "string",
         "statusReason": "string"
      }
   ]
}
```

## Response Elements
<a name="API_ListSourcesForS3TableIntegration_ResponseElements"></a>

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

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

 ** [nextToken](#API_ListSourcesForS3TableIntegration_ResponseSyntax) **   <a name="CWL-ListSourcesForS3TableIntegration-response-nextToken"></a>
The token for the next set of items to return. The token expires after 24 hours.  
Type: String  
Length Constraints: Minimum length of 1.

 ** [sources](#API_ListSourcesForS3TableIntegration_ResponseSyntax) **   <a name="CWL-ListSourcesForS3TableIntegration-response-sources"></a>
The list of data source associations for the specified S3 Table Integration.  
Type: Array of [S3TableIntegrationSource](API_S3TableIntegrationSource.md) objects

## Errors
<a name="API_ListSourcesForS3TableIntegration_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have sufficient permissions to perform this action.  
HTTP Status Code: 400

 ** InternalServerException **   
An internal server error occurred while processing the request. This exception is returned when the service encounters an unexpected condition that prevents it from fulfilling the request.  
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The specified resource does not exist.  
HTTP Status Code: 400

 ** ThrottlingException **   
The request was throttled because of quota limits.  
HTTP Status Code: 400

 ** ValidationException **   
One of the parameters for the request is not valid.  
HTTP Status Code: 400

## See Also
<a name="API_ListSourcesForS3TableIntegration_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/ListSourcesForS3TableIntegration) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/ListSourcesForS3TableIntegration) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/ListSourcesForS3TableIntegration) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/ListSourcesForS3TableIntegration) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/ListSourcesForS3TableIntegration) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/ListSourcesForS3TableIntegration) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/ListSourcesForS3TableIntegration) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/ListSourcesForS3TableIntegration) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/ListSourcesForS3TableIntegration) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/ListSourcesForS3TableIntegration) 

# ListTagsForResource
<a name="API_ListTagsForResource"></a>

Displays the tags associated with a CloudWatch Logs resource. Currently, log groups and destinations support tagging.

## Request Syntax
<a name="API_ListTagsForResource_RequestSyntax"></a>

```
{
   "resourceArn": "string"
}
```

## Request Parameters
<a name="API_ListTagsForResource_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [resourceArn](#API_ListTagsForResource_RequestSyntax) **   <a name="CWL-ListTagsForResource-request-resourceArn"></a>
The ARN of the resource that you want to view tags for.  
The ARN format of a log group is `arn:aws:logs:Region:account-id:log-group:log-group-name `   
The ARN format of a destination is `arn:aws:logs:Region:account-id:destination:destination-name `   
For more information about ARN format, see [CloudWatch Logs resources and operations](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html).  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 1011.  
Pattern: `[\w+=/:,.@-]*`   
Required: Yes

## Response Syntax
<a name="API_ListTagsForResource_ResponseSyntax"></a>

```
{
   "tags": { 
      "string" : "string" 
   }
}
```

## Response Elements
<a name="API_ListTagsForResource_ResponseElements"></a>

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

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

 ** [tags](#API_ListTagsForResource_ResponseSyntax) **   <a name="CWL-ListTagsForResource-response-tags"></a>
The list of tags associated with the requested resource.>  
Type: String to string map  
Map Entries: Maximum number of 50 items.  
Key Length Constraints: Minimum length of 1. Maximum length of 128.  
Key Pattern: `^([\p{L}\p{Z}\p{N}_.:/=+\-@]+)$`   
Value Length Constraints: Maximum length of 256.  
Value Pattern: `^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$` 

## Errors
<a name="API_ListTagsForResource_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** 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

## See Also
<a name="API_ListTagsForResource_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/ListTagsForResource) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/ListTagsForResource) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/ListTagsForResource) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/ListTagsForResource) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/ListTagsForResource) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/ListTagsForResource) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/ListTagsForResource) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/ListTagsForResource) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/ListTagsForResource) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/ListTagsForResource) 

# ListTagsLogGroup
<a name="API_ListTagsLogGroup"></a>

 *This action has been deprecated.* 

**Important**  
The ListTagsLogGroup operation is on the path to deprecation. We recommend that you use [ListTagsForResource](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_ListTagsForResource.html) instead.

Lists the tags for the specified log group.

## Request Syntax
<a name="API_ListTagsLogGroup_RequestSyntax"></a>

```
{
   "logGroupName": "string"
}
```

## Request Parameters
<a name="API_ListTagsLogGroup_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [logGroupName](#API_ListTagsLogGroup_RequestSyntax) **   <a name="CWL-ListTagsLogGroup-request-logGroupName"></a>
The name of the log group.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[\.\-_/#A-Za-z0-9]+`   
Required: Yes

## Response Syntax
<a name="API_ListTagsLogGroup_ResponseSyntax"></a>

```
{
   "tags": { 
      "string" : "string" 
   }
}
```

## Response Elements
<a name="API_ListTagsLogGroup_ResponseElements"></a>

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

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

 ** [tags](#API_ListTagsLogGroup_ResponseSyntax) **   <a name="CWL-ListTagsLogGroup-response-tags"></a>
The tags for the log group.  
Type: String to string map  
Map Entries: Maximum number of 50 items.  
Key Length Constraints: Minimum length of 1. Maximum length of 128.  
Key Pattern: `^([\p{L}\p{Z}\p{N}_.:/=+\-@]+)$`   
Value Length Constraints: Maximum length of 256.  
Value Pattern: `^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$` 

## Errors
<a name="API_ListTagsLogGroup_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ResourceNotFoundException **   
The specified resource does not exist.  
HTTP Status Code: 400

 ** ServiceUnavailableException **   
The service cannot complete the request.  
HTTP Status Code: 500

## See Also
<a name="API_ListTagsLogGroup_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/ListTagsLogGroup) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/ListTagsLogGroup) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/ListTagsLogGroup) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/ListTagsLogGroup) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/ListTagsLogGroup) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/ListTagsLogGroup) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/ListTagsLogGroup) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/ListTagsLogGroup) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/ListTagsLogGroup) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/ListTagsLogGroup) 

# PutAccountPolicy
<a name="API_PutAccountPolicy"></a>

Creates an account-level data protection policy, subscription filter policy, field index policy, transformer policy, or metric extraction policy that applies to all log groups, a subset of log groups, or a data source name and type combination in the account.

For field index policies, you can configure indexed fields as *facets* to enable interactive exploration of your logs. Facets provide value distributions and counts for indexed fields in the CloudWatch Logs Insights console without requiring query execution. For more information, see [Use facets to group and explore logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatchLogs-Facets.html).

To use this operation, you must be signed on with the correct permissions depending on the type of policy that you are creating.
+ To create a data protection policy, you must have the `logs:PutDataProtectionPolicy` and `logs:PutAccountPolicy` permissions.
+ To create a subscription filter policy, you must have the `logs:PutSubscriptionFilter` and `logs:PutAccountPolicy` permissions.
+ To create a transformer policy, you must have the `logs:PutTransformer` and `logs:PutAccountPolicy` permissions.
+ To create a field index policy, you must have the `logs:PutIndexPolicy` and `logs:PutAccountPolicy` permissions.
+ To configure facets for field index policies, you must have the `logs:PutIndexPolicy` and `logs:PutAccountPolicy` permissions.
+ To create a metric extraction policy, you must have the `logs:PutMetricExtractionPolicy` and `logs:PutAccountPolicy` permissions.

 **Data protection policy** 

A data protection policy can help safeguard sensitive data that's ingested by your log groups by auditing and masking the sensitive log data. Each account can have only one account-level data protection policy.

**Important**  
Sensitive data is detected and masked when it is ingested into a log group. When you set a data protection policy, log events ingested into the log groups before that time are not masked.

If you use `PutAccountPolicy` to create a data protection policy for your whole account, it applies to both existing log groups and all log groups that are created later in this account. The account-level policy is applied to existing log groups with eventual consistency. It might take up to 5 minutes before sensitive data in existing log groups begins to be masked.

By default, when a user views a log event that includes masked data, the sensitive data is replaced by asterisks. A user who has the `logs:Unmask` permission can use a [GetLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_GetLogEvents.html) or [FilterLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_FilterLogEvents.html) operation with the `unmask` parameter set to `true` to view the unmasked log events. Users with the `logs:Unmask` can also view unmasked data in the CloudWatch Logs console by running a CloudWatch Logs Insights query with the `unmask` query command.

For more information, including a list of types of data that can be audited and masked, see [Protect sensitive log data with masking](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/mask-sensitive-log-data.html).

To use the `PutAccountPolicy` operation for a data protection policy, you must be signed on with the `logs:PutDataProtectionPolicy` and `logs:PutAccountPolicy` permissions.

The `PutAccountPolicy` operation applies to all log groups in the account. You can use [PutDataProtectionPolicy](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDataProtectionPolicy.html) to create a data protection policy that applies to just one log group. If a log group has its own data protection policy and the account also has an account-level data protection policy, then the two policies are cumulative. Any sensitive term specified in either policy is masked.

 **Subscription filter policy** 

A subscription filter policy sets up a real-time feed of log events from CloudWatch Logs to other AWS services. Account-level subscription filter policies apply to both existing log groups and log groups that are created later in this account. Supported destinations are Kinesis Data Streams, Firehose, and Lambda. When log events are sent to the receiving service, they are Base64 encoded and compressed with the GZIP format.

The following destinations are supported for subscription filters:
+ An Kinesis Data Streams data stream in the same account as the subscription policy, for same-account delivery.
+ An Firehose data stream in the same account as the subscription policy, for same-account delivery.
+ A Lambda function in the same account as the subscription policy, for same-account delivery.
+ A logical destination in a different account created with [PutDestination](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDestination.html), for cross-account delivery. Kinesis Data Streams and Firehose are supported as logical destinations.

Each account can have one account-level subscription filter policy per Region. If you are updating an existing filter, you must specify the correct name in `PolicyName`. To perform a `PutAccountPolicy` subscription filter operation for any destination except a Lambda function, you must also have the `iam:PassRole` permission.

 **Transformer policy** 

Creates or updates a *log transformer policy* for your account. You use log transformers to transform log events into a different format, making them easier for you to process and analyze. You can also transform logs from different sources into standardized formats that contain relevant, source-specific information. After you have created a transformer, CloudWatch Logs performs this transformation at the time of log ingestion. You can then refer to the transformed versions of the logs during operations such as querying with CloudWatch Logs Insights or creating metric filters or subscription filters.

You can also use a transformer to copy metadata from metadata keys into the log events themselves. This metadata can include log group name, log stream name, account ID and Region.

A transformer for a log group is a series of processors, where each processor applies one type of transformation to the log events ingested into this log group. For more information about the available processors to use in a transformer, see [ Processors that you can use](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-Processors).

Having log events in standardized format enables visibility across your applications for your log analysis, reporting, and alarming needs. CloudWatch Logs provides transformation for common log types with out-of-the-box transformation templates for major AWS log sources such as VPC flow logs, Lambda, and Amazon RDS. You can use pre-built transformation templates or create custom transformation policies.

You can create transformers only for the log groups in the Standard log class.

You can have one account-level transformer policy that applies to all log groups in the account. Or you can create as many as 20 account-level transformer policies that are each scoped to a subset of log groups with the `selectionCriteria` parameter. If you have multiple account-level transformer policies with selection criteria, no two of them can use the same or overlapping log group name prefixes. For example, if you have one policy filtered to log groups that start with `my-log`, you can't have another transformer policy filtered to `my-logpprod` or `my-logging`.

You can also set up a transformer at the log-group level. For more information, see [PutTransformer](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutTransformer.html). If there is both a log-group level transformer created with `PutTransformer` and an account-level transformer that could apply to the same log group, the log group uses only the log-group level transformer. It ignores the account-level transformer.

 **Field index policy** 

You can use field index policies to create indexes on fields found in log events for a log group or data source name and type combination. Creating field indexes can help lower the scan volume for CloudWatch Logs Insights queries that reference those fields, because these queries attempt to skip the processing of log events that are known to not match the indexed field. Good fields to index are fields that you often need to query for and fields or values that match only a small fraction of the total log events. Common examples of indexes include request ID, session ID, user IDs, or instance IDs. For more information, see [Create field indexes to improve query performance and reduce costs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatchLogs-Field-Indexing.html) 

To find the fields that are in your log group events, use the [GetLogGroupFields](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_GetLogGroupFields.html) operation. To find the fields for a data source use the [GetLogFields](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_GetLogFields.html) operation.

For example, suppose you have created a field index for `requestId`. Then, any CloudWatch Logs Insights query on that log group that includes `requestId = value ` or `requestId in [value, value, ...]` will attempt to process only the log events where the indexed field matches the specified value.

Matches of log events to the names of indexed fields are case-sensitive. For example, an indexed field of `RequestId` won't match a log event containing `requestId`.

You can have one account-level field index policy that applies to all log groups in the account. Or you can create as many as 20 account-level field index policies that are each scoped to a subset of log groups using `LogGroupNamePrefix` with the `selectionCriteria` parameter. You can have another 20 account-level field index policies using `DataSourceName` and `DataSourceType` for the `selectionCriteria` parameter. If you have multiple account-level index policies with `LogGroupNamePrefix` selection criteria, no two of them can use the same or overlapping log group name prefixes. For example, if you have one policy filtered to log groups that start with *my-log*, you can't have another field index policy filtered to *my-logpprod* or *my-logging*. Similarly, if you have multiple account-level index policies with `DataSourceName` and `DataSourceType` selection criteria, no two of them can use the same data source name and type combination. For example, if you have one policy filtered to the data source name `amazon_vpc` and data source type `flow` you cannot create another policy with this combination.

If you create an account-level field index policy in a monitoring account in cross-account observability, the policy is applied only to the monitoring account and not to any source accounts.

CloudWatch Logs provides default field indexes for all log groups in the Standard log class. Default field indexes are automatically available for the following fields: 
+  `@logStream` 
+  `@aws.region` 
+  `@aws.account` 
+  `@source.log` 
+  `@data_source_name` 
+  `@data_source_type` 
+  `@data_format` 
+  `traceId` 
+  `severityText` 
+  `attributes.session.id` 

CloudWatch Logs provides default field indexes for certain data source name and type combinations as well. Default field indexes are automatically available for the following data source name and type combinations as identified in the following list:

 `amazon_vpc.flow` 
+  `action` 
+  `logStatus` 
+  `region` 
+  `flowDirection` 
+  `type` 

 `amazon_route53.resolver_query` 
+  `transport` 
+  `rcode` 

 `aws_waf.access` 
+  `action` 
+  `httpRequest.country` 

 `aws_cloudtrail.data`, `aws_cloudtrail.management` 
+  `eventSource` 
+  `eventName` 
+  `awsRegion` 
+  `userAgent` 
+  `errorCode` 
+  `eventType` 
+  `managementEvent` 
+  `readOnly` 
+  `eventCategory` 
+  `requestId` 

Default field indexes are in addition to any custom field indexes you define within your policy. Default field indexes are not counted towards your [field index quota](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatchLogs-Field-Indexing-Syntax). 

If you want to create a field index policy for a single log group, you can use [PutIndexPolicy](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutIndexPolicy.html) instead of `PutAccountPolicy`. If you do so, that log group will use that log-group level policy and any account-level policies that match at the data source level; any account-level policy that matches at the log group level (for example, no selection criteria or log group name prefix selection criteria) will be ignored.

 **Metric extraction policy** 

A metric extraction policy controls whether CloudWatch Metrics can be created through the Embedded Metrics Format (EMF) for log groups in your account. By default, EMF metric creation is enabled for all log groups. You can use metric extraction policies to disable EMF metric creation for your entire account or specific log groups.

When a policy disables EMF metric creation for a log group, log events in the EMF format are still ingested, but no CloudWatch Metrics are created from them.

**Important**  
Creating a policy disables metrics for AWS features that use EMF to create metrics, such as CloudWatch Container Insights and CloudWatch Application Signals. To prevent turning off those features by accident, we recommend that you exclude the underlying log-groups through a selection-criteria such as `LogGroupNamePrefix NOT IN ["/aws/containerinsights", "/aws/ecs/containerinsights", "/aws/application-signals/data"]`.

Each account can have either one account-level metric extraction policy that applies to all log groups, or up to 5 policies that are each scoped to a subset of log groups with the `selectionCriteria` parameter. The selection criteria supports filtering by `LogGroupName` and `LogGroupNamePrefix` using the operators `IN` and `NOT IN`. You can specify up to 50 values in each `IN` or `NOT IN` list.

The selection criteria can be specified in these formats:

 `LogGroupName IN ["log-group-1", "log-group-2"]` 

 `LogGroupNamePrefix NOT IN ["/aws/prefix1", "/aws/prefix2"]` 

If you have multiple account-level metric extraction policies with selection criteria, no two of them can have overlapping criteria. For example, if you have one policy with selection criteria `LogGroupNamePrefix IN ["my-log"]`, you can't have another metric extraction policy with selection criteria `LogGroupNamePrefix IN ["/my-log-prod"]` or `LogGroupNamePrefix IN ["/my-logging"]`, as the set of log groups matching these prefixes would be a subset of the log groups matching the first policy's prefix, creating an overlap.

When using `NOT IN`, only one policy with this operator is allowed per account.

When combining policies with `IN` and `NOT IN` operators, the overlap check ensures that policies don't have conflicting effects. Two policies with `IN` and `NOT IN` operators do not overlap if and only if every value in the `IN `policy is completely contained within some value in the `NOT IN` policy. For example:
+ If you have a `NOT IN` policy for prefix `"/aws/lambda"`, you can create an `IN` policy for the exact log group name `"/aws/lambda/function1"` because the set of log groups matching `"/aws/lambda/function1"` is a subset of the log groups matching `"/aws/lambda"`.
+ If you have a `NOT IN` policy for prefix `"/aws/lambda"`, you cannot create an `IN` policy for prefix `"/aws"` because the set of log groups matching `"/aws"` is not a subset of the log groups matching `"/aws/lambda"`.

## Request Syntax
<a name="API_PutAccountPolicy_RequestSyntax"></a>

```
{
   "policyDocument": "string",
   "policyName": "string",
   "policyType": "string",
   "scope": "string",
   "selectionCriteria": "string"
}
```

## Request Parameters
<a name="API_PutAccountPolicy_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [policyDocument](#API_PutAccountPolicy_RequestSyntax) **   <a name="CWL-PutAccountPolicy-request-policyDocument"></a>
Specify the policy, in JSON.  
 **Data protection policy**   
A data protection policy must include two JSON blocks:  
+ The first block must include both a `DataIdentifer` array and an `Operation` property with an `Audit` action. The `DataIdentifer` array lists the types of sensitive data that you want to mask. For more information about the available options, see [Types of data that you can mask](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/mask-sensitive-log-data-types.html).

  The `Operation` property with an `Audit` action is required to find the sensitive data terms. This `Audit` action must contain a `FindingsDestination` object. You can optionally use that `FindingsDestination` object to list one or more destinations to send audit findings to. If you specify destinations such as log groups, Firehose streams, and S3 buckets, they must already exist.
+ The second block must include both a `DataIdentifer` array and an `Operation` property with an `Deidentify` action. The `DataIdentifer` array must exactly match the `DataIdentifer` array in the first block of the policy.

  The `Operation` property with the `Deidentify` action is what actually masks the data, and it must contain the ` "MaskConfig": {}` object. The ` "MaskConfig": {}` object must be empty.
For an example data protection policy, see the **Examples** section on this page.  
The contents of the two `DataIdentifer` arrays must match exactly.
In addition to the two JSON blocks, the `policyDocument` can also include `Name`, `Description`, and `Version` fields. The `Name` is different than the operation's `policyName` parameter, and is used as a dimension when CloudWatch Logs reports audit findings metrics to CloudWatch.  
The JSON specified in `policyDocument` can be up to 30,720 characters long.  
 **Subscription filter policy**   
A subscription filter policy can include the following attributes in a JSON block:  
+  **DestinationArn** The ARN of the destination to deliver log events to. Supported destinations are:
  + An Kinesis Data Streams data stream in the same account as the subscription policy, for same-account delivery.
  + An Firehose data stream in the same account as the subscription policy, for same-account delivery.
  + A Lambda function in the same account as the subscription policy, for same-account delivery.
  + A logical destination in a different account created with [PutDestination](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDestination.html), for cross-account delivery. Kinesis Data Streams and Firehose are supported as logical destinations.
+  **RoleArn** The ARN of an IAM role that grants CloudWatch Logs permissions to deliver ingested log events to the destination stream. You don't need to provide the ARN when you are working with a logical destination for cross-account delivery.
+  **FilterPattern** A filter pattern for subscribing to a filtered stream of log events.
+  **Distribution** The method used to distribute log data to the destination. By default, log data is grouped by log stream, but the grouping can be set to `Random` for a more even distribution. This property is only applicable when the destination is an Kinesis Data Streams data stream.
 **Transformer policy**   
A transformer policy must include one JSON block with the array of processors and their configurations. For more information about available processors, see [ Processors that you can use](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-Processors).   
 **Field index policy**   
A field index filter policy can include the following attribute in a JSON block:  
+  **Fields** The array of field indexes to create.
+  **FieldsV2** The object of field indexes to create along with it's type.
It must contain at least one field index.  
The following is an example of an index policy document that creates indexes with different types.  
 `"policyDocument": "{ \"Fields\": [ \"TransactionId\" ], \"FieldsV2\": {\"RequestId\": {\"type\": \"FIELD_INDEX\"}, \"APIName\": {\"type\": \"FACET\"}, \"StatusCode\": {\"type\": \"FACET\"}}}"`   
You can use `FieldsV2` to specify the type for each field. Supported types are `FIELD_INDEX` and `FACET`. Field names within `Fields` and `FieldsV2` must be mutually exclusive.  
Type: String  
Required: Yes

 ** [policyName](#API_PutAccountPolicy_RequestSyntax) **   <a name="CWL-PutAccountPolicy-request-policyName"></a>
A name for the policy. This must be unique within the account and cannot start with `aws/`.  
Type: String  
Required: Yes

 ** [policyType](#API_PutAccountPolicy_RequestSyntax) **   <a name="CWL-PutAccountPolicy-request-policyType"></a>
The type of policy that you're creating or updating.  
Type: String  
Valid Values: `DATA_PROTECTION_POLICY | SUBSCRIPTION_FILTER_POLICY | FIELD_INDEX_POLICY | TRANSFORMER_POLICY | METRIC_EXTRACTION_POLICY`   
Required: Yes

 ** [scope](#API_PutAccountPolicy_RequestSyntax) **   <a name="CWL-PutAccountPolicy-request-scope"></a>
Currently the only valid value for this parameter is `ALL`, which specifies that the data protection policy applies to all log groups in the account. If you omit this parameter, the default of `ALL` is used.  
Type: String  
Valid Values: `ALL`   
Required: No

 ** [selectionCriteria](#API_PutAccountPolicy_RequestSyntax) **   <a name="CWL-PutAccountPolicy-request-selectionCriteria"></a>
Use this parameter to apply the new policy to a subset of log groups in the account or a data source name and type combination.   
Specifying `selectionCriteria` is valid only when you specify `SUBSCRIPTION_FILTER_POLICY`, `FIELD_INDEX_POLICY` or `TRANSFORMER_POLICY`for `policyType`.  
+ If `policyType` is `SUBSCRIPTION_FILTER_POLICY`, the only supported `selectionCriteria` filter is `LogGroupName NOT IN []` 
+ If `policyType` is `TRANSFORMER_POLICY`, the only supported `selectionCriteria` filter is `LogGroupNamePrefix` 
+ If `policyType` is `FIELD_INDEX_POLICY`, the supported `selectionCriteria` filters are:
  +  `LogGroupNamePrefix` 
  +  `DataSourceName` AND `DataSourceType` 

  When you specify `selectionCriteria` for a field index policy you can use either `LogGroupNamePrefix` by itself or `DataSourceName` and `DataSourceType` together.
The `selectionCriteria` string can be up to 25KB in length. The length is determined by using its UTF-8 bytes.  
Using the `selectionCriteria` parameter with `SUBSCRIPTION_FILTER_POLICY` is useful to help prevent infinite loops. For more information, see [Log recursion prevention](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Subscriptions-recursion-prevention.html).  
Type: String  
Required: No

## Response Syntax
<a name="API_PutAccountPolicy_ResponseSyntax"></a>

```
{
   "accountPolicy": { 
      "accountId": "string",
      "lastUpdatedTime": number,
      "policyDocument": "string",
      "policyName": "string",
      "policyType": "string",
      "scope": "string",
      "selectionCriteria": "string"
   }
}
```

## Response Elements
<a name="API_PutAccountPolicy_ResponseElements"></a>

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

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

 ** [accountPolicy](#API_PutAccountPolicy_ResponseSyntax) **   <a name="CWL-PutAccountPolicy-response-accountPolicy"></a>
The account policy that you created.  
Type: [AccountPolicy](API_AccountPolicy.md) object

## Errors
<a name="API_PutAccountPolicy_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** LimitExceededException **   
You have reached the maximum number of resources that can be created.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
HTTP Status Code: 400

 ** ServiceUnavailableException **   
The service cannot complete the request.  
HTTP Status Code: 500

## Examples
<a name="API_PutAccountPolicy_Examples"></a>

### To create a log transformer policy
<a name="API_PutAccountPolicy_Example_1"></a>

The following example creates a log transformer that applies to log groups have names that start with `test-` 

#### Sample Request
<a name="API_PutAccountPolicy_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.PutAccountPolicy
{
    "policyName": "ExamplePolicy",
    "policyType": "TRANSFORMER_POLICY",
    "policyDocument": [
        {
            "parseJSON": {}
        },
        {
            "addKeys": {
                "entries": [
                    {
                        "key": "metadata.transformed_in",
                        "value": "CloudWatchLogs"
                    }
                ]
            }
        },
        {
            "trimString": {
                "withKeys": [
                    "status"
                ]
            }
        },
        {
            "lowerCaseString": {
                "withKeys": [
                    "status"
                ]
            }
        }
    ],
	"selectionCriteria": 'LogGroupNamePrefix= "test-"'
}
```

### To create a metric extraction policy
<a name="API_PutAccountPolicy_Example_2"></a>

The following example creates a metric extraction policy that disables EMF metric creation for all log groups except Container Insights log groups.

#### Sample Request
<a name="API_PutAccountPolicy_Example_2_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.PutAccountPolicy
{
    "policyName": "DisableEMFMetrics",
    "policyType": "METRIC_EXTRACTION_POLICY",
    "policyDocument": {
        "EmbeddedMetricFormat": {
            "Status": "Disabled"
        }
    },
    "selectionCriteria": 'LogGroupNamePrefix NOT IN ["/aws/containerinsights", "/aws/ecs/containerinsights"]'
}
```

### To create an account-wide data protection policy
<a name="API_PutAccountPolicy_Example_3"></a>

The following example creates an account-wide log group data protection policy.

#### Sample Request
<a name="API_PutAccountPolicy_Example_3_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.PutAccountPolicy
{
    "policyName": "my_global_data_protection_policy",
    "policyType": "GLOBAL",
    "policyDocument": {
        "Description": "test description",
        "Version": "2021-06-01",
        "Statement": [
            {
                "Sid": "audit-policy test",
                "DataIdentifier": [
                    "arn:aws:dataprotection::aws:data-identifier/EmailAddress",
                    "arn:aws:dataprotection::aws:data-identifier/DriversLicense-US"
                ],
                "Operation": {
                    "Audit": {
                        "FindingsDestination": {
                            "CloudWatchLogs": {
                                "LogGroup": "EXISTING_LOG_GROUP_IN_YOUR_ACCOUNT"
                            },
                            "Firehose": {
                                "DeliveryStream": "EXISTING_STREAM_IN_YOUR_ACCOUNT"
                            },
                            "S3": {
                                "Bucket": "EXISTING_BUCKET"
                            }
                        }
                    }
                }
            },
            {
            {
                "Sid": "redact-policy",
                "DataIdentifier": [
                    "arn:aws:dataprotection::aws:data-identifier/EmailAddress",
                    "arn:aws:dataprotection::aws:data-identifier/DriversLicense-US"
                ],
                "Operation": {
                    "Deidentify": {
                        "MaskConfig": {}
                    }
                }
            }
        ]
    }
}
```

### To create an account-wide subscription filter policy
<a name="API_PutAccountPolicy_Example_4"></a>

The following example creates an account-wide subscription filter policy that forwards log events containing the string `ERROR` to a Kinesis Data Streams stream. The policy applies to all log groups in the account except for `LogGroupToExclude1` and `LogGroupToExclude12`.

#### Sample Request
<a name="API_PutAccountPolicy_Example_4_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.PutAccountPolicy
{
    "policyName": "ExamplePolicy",
    "policyType": "SUBSCRIPTION_FILTER_POLICY",
    "policyDocument": {
        "DestinationArn":"arn:aws:kinesis:region:111111111111:stream/TestStream",
        "RoleArn":"arn:aws:iam::111111111111:role/CWLtoKinesisRole",
        "FilterPattern": "ERROR",
        "Distribution": "Random"
    },
    "selectionCriteria": 'LogGroupName NOT IN ["LogGroupToExclude1", "LogGroupToExclude2"]'
}
```

### To create an account-wide field index policy
<a name="API_PutAccountPolicy_Example_5"></a>

The following example creates an account-wide field index policy for log groups with names that start with `lambda`.

#### Sample Request
<a name="API_PutAccountPolicy_Example_5_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.PutAccountPolicy
{
    "policyDocument": {
        "Fields": ["RequestId", "TransactionId"]
     },
    "policyName": "LambdaIndexPolicy",
    "policyType" : "FIELD_INDEX_POLICY",
    "scope" : "ALL",
    "selectionCriteria": 'LogGroupNamePrefix="lambda"'
}
```

## See Also
<a name="API_PutAccountPolicy_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/PutAccountPolicy) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/PutAccountPolicy) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/PutAccountPolicy) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/PutAccountPolicy) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/PutAccountPolicy) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/PutAccountPolicy) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/PutAccountPolicy) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/PutAccountPolicy) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/PutAccountPolicy) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/PutAccountPolicy) 

# PutBearerTokenAuthentication
<a name="API_PutBearerTokenAuthentication"></a>

Enables or disables bearer token authentication for the specified log group. When enabled on a log group, bearer token authentication is enabled on operations until it is explicitly disabled.

For information about the parameters that are common to all actions, see [Common Parameters](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/CommonParameters.html).

## Request Syntax
<a name="API_PutBearerTokenAuthentication_RequestSyntax"></a>

```
{
   "bearerTokenAuthenticationEnabled": boolean,
   "logGroupIdentifier": "string"
}
```

## Request Parameters
<a name="API_PutBearerTokenAuthentication_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [bearerTokenAuthenticationEnabled](#API_PutBearerTokenAuthentication_RequestSyntax) **   <a name="CWL-PutBearerTokenAuthentication-request-bearerTokenAuthenticationEnabled"></a>
Whether to enable bearer token authentication.  
Type: Boolean  
Required: Yes  
Type: Boolean  
Required: Yes

 ** [logGroupIdentifier](#API_PutBearerTokenAuthentication_RequestSyntax) **   <a name="CWL-PutBearerTokenAuthentication-request-logGroupIdentifier"></a>
The name or ARN of the log group.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[\.\-_/#A-Za-z0-9]+`   
Required: Yes  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Pattern: `[\w#+=/:,.@-]*`   
Required: Yes

## Response Elements
<a name="API_PutBearerTokenAuthentication_ResponseElements"></a>

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

## Errors
<a name="API_PutBearerTokenAuthentication_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have sufficient permissions to perform this action.  
HTTP Status Code: 400

 ** InvalidOperationException **   
The operation is not valid on the specified resource.  
HTTP Status Code: 400

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
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
<a name="API_PutBearerTokenAuthentication_Examples"></a>

### Sample Request
<a name="API_PutBearerTokenAuthentication_Example_1"></a>

This example illustrates one usage of PutBearerTokenAuthentication.

#### Sample Request
<a name="API_PutBearerTokenAuthentication_Example_1_Request"></a>

```
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>
          User-Agent: <UserAgentString>
          Accept: application/json
          Content-Type: application/x-amz-json-1.1
          Content-Length: <PayloadSizeBytes>
          Connection: Keep-Alive
          X-Amz-Target: Logs_20140328.PutBearerTokenAuthentication
          {
          "logGroupIdentifier": "my-log-group",
          "bearerTokenAuthenticationEnabled": true
          }
```

#### Sample Response
<a name="API_PutBearerTokenAuthentication_Example_1_Response"></a>

```
HTTP/1.1 200 OK
          x-amzn-RequestId: <RequestId>
          Content-Type: application/x-amz-json-1.1
          Content-Length: 0
          Date: <Date>
```

## See Also
<a name="API_PutBearerTokenAuthentication_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/PutBearerTokenAuthentication) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/PutBearerTokenAuthentication) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/PutBearerTokenAuthentication) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/PutBearerTokenAuthentication) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/PutBearerTokenAuthentication) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/PutBearerTokenAuthentication) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/PutBearerTokenAuthentication) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/PutBearerTokenAuthentication) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/PutBearerTokenAuthentication) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/PutBearerTokenAuthentication) 

# PutDataProtectionPolicy
<a name="API_PutDataProtectionPolicy"></a>

Creates a data protection policy for the specified log group. A data protection policy can help safeguard sensitive data that's ingested by the log group by auditing and masking the sensitive log data.

**Important**  
Sensitive data is detected and masked when it is ingested into the log group. When you set a data protection policy, log events ingested into the log group before that time are not masked.

By default, when a user views a log event that includes masked data, the sensitive data is replaced by asterisks. A user who has the `logs:Unmask` permission can use a [GetLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_GetLogEvents.html) or [FilterLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_FilterLogEvents.html) operation with the `unmask` parameter set to `true` to view the unmasked log events. Users with the `logs:Unmask` can also view unmasked data in the CloudWatch Logs console by running a CloudWatch Logs Insights query with the `unmask` query command.

For more information, including a list of types of data that can be audited and masked, see [Protect sensitive log data with masking](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/mask-sensitive-log-data.html).

The `PutDataProtectionPolicy` operation applies to only the specified log group. You can also use [PutAccountPolicy](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutAccountPolicy.html) to create an account-level data protection policy that applies to all log groups in the account, including both existing log groups and log groups that are created level. If a log group has its own data protection policy and the account also has an account-level data protection policy, then the two policies are cumulative. Any sensitive term specified in either policy is masked.

## Request Syntax
<a name="API_PutDataProtectionPolicy_RequestSyntax"></a>

```
{
   "logGroupIdentifier": "string",
   "policyDocument": "string"
}
```

## Request Parameters
<a name="API_PutDataProtectionPolicy_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [logGroupIdentifier](#API_PutDataProtectionPolicy_RequestSyntax) **   <a name="CWL-PutDataProtectionPolicy-request-logGroupIdentifier"></a>
Specify either the log group name or log group ARN.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Pattern: `[\w#+=/:,.@-]*`   
Required: Yes

 ** [policyDocument](#API_PutDataProtectionPolicy_RequestSyntax) **   <a name="CWL-PutDataProtectionPolicy-request-policyDocument"></a>
Specify the data protection policy, in JSON.  
This policy must include two JSON blocks:  
+ The first block must include both a `DataIdentifer` array and an `Operation` property with an `Audit` action. The `DataIdentifer` array lists the types of sensitive data that you want to mask. For more information about the available options, see [Types of data that you can mask](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/mask-sensitive-log-data-types.html).

  The `Operation` property with an `Audit` action is required to find the sensitive data terms. This `Audit` action must contain a `FindingsDestination` object. You can optionally use that `FindingsDestination` object to list one or more destinations to send audit findings to. If you specify destinations such as log groups, Firehose streams, and S3 buckets, they must already exist.
+ The second block must include both a `DataIdentifer` array and an `Operation` property with an `Deidentify` action. The `DataIdentifer` array must exactly match the `DataIdentifer` array in the first block of the policy.

  The `Operation` property with the `Deidentify` action is what actually masks the data, and it must contain the ` "MaskConfig": {}` object. The ` "MaskConfig": {}` object must be empty.
For an example data protection policy, see the **Examples** section on this page.  
The contents of the two `DataIdentifer` arrays must match exactly.
In addition to the two JSON blocks, the `policyDocument` can also include `Name`, `Description`, and `Version` fields. The `Name` is used as a dimension when CloudWatch Logs reports audit findings metrics to CloudWatch.  
The JSON specified in `policyDocument` can be up to 30,720 characters.  
Type: String  
Required: Yes

## Response Syntax
<a name="API_PutDataProtectionPolicy_ResponseSyntax"></a>

```
{
   "lastUpdatedTime": number,
   "logGroupIdentifier": "string",
   "policyDocument": "string"
}
```

## Response Elements
<a name="API_PutDataProtectionPolicy_ResponseElements"></a>

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

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

 ** [lastUpdatedTime](#API_PutDataProtectionPolicy_ResponseSyntax) **   <a name="CWL-PutDataProtectionPolicy-response-lastUpdatedTime"></a>
The date and time that this policy was most recently updated.  
Type: Long  
Valid Range: Minimum value of 0.

 ** [logGroupIdentifier](#API_PutDataProtectionPolicy_ResponseSyntax) **   <a name="CWL-PutDataProtectionPolicy-response-logGroupIdentifier"></a>
The log group name or ARN that you specified in your request.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Pattern: `[\w#+=/:,.@-]*` 

 ** [policyDocument](#API_PutDataProtectionPolicy_ResponseSyntax) **   <a name="CWL-PutDataProtectionPolicy-response-policyDocument"></a>
The data protection policy used for this log group.  
Type: String

## Errors
<a name="API_PutDataProtectionPolicy_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** LimitExceededException **   
You have reached the maximum number of resources that can be created.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
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
<a name="API_PutDataProtectionPolicy_Examples"></a>

### To create a data protection policy
<a name="API_PutDataProtectionPolicy_Example_1"></a>

The following example creates a data protection policy in the log group.

#### Sample Request
<a name="API_PutDataProtectionPolicy_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.PutDataProtectionPolicy
{
    "logGroupIdentifier": "my-log-group",
    "policyDocument": {
        "Name": "data-protection-policy",
        "Description": "test description",
        "Version": "2021-06-01",
        "Statement": [
            {
                "Sid": "audit-policy test",
                "DataIdentifier": [
                    "arn:aws:dataprotection::aws:data-identifier/EmailAddress",
                    "arn:aws:dataprotection::aws:data-identifier/DriversLicense-US"
                ],
                "Operation": {
                    "Audit": {
                        "FindingsDestination": {
                            "CloudWatchLogs": {
                                "LogGroup": "EXISTING_LOG_GROUP_IN_YOUR_ACCOUNT"
                            },
                            "Firehose": {
                                "DeliveryStream": "EXISTING_STREAM_IN_YOUR_ACCOUNT"
                            },
                            "S3": {
                                "Bucket": "EXISTING_BUCKET"
                            }
                        }
                    }
                }
            },
            {
                "Sid": "redact-policy",
                "DataIdentifier": [
                    "arn:aws:dataprotection::aws:data-identifier/EmailAddress",
                    "arn:aws:dataprotection::aws:data-identifier/DriversLicense-US"
                ],
                "Operation": {
                    "Deidentify": {
                        "MaskConfig": {}
                    }
                }
            }
        ]
    }
}
```

#### Sample Response
<a name="API_PutDataProtectionPolicy_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
```

### To create a log transformer policy
<a name="API_PutDataProtectionPolicy_Example_2"></a>

The following example creates a log transformer policy in the account that applies to all log groups with names that start with `test-`.

#### Sample Request
<a name="API_PutDataProtectionPolicy_Example_2_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.PutDataProtectionPolicy
{
    "policyName": "ExampleTransformerPolicy",
    "policyType": "TRANSFORMER_POLICY",
    "selectionCriteria": 'LogGroupNamePrefix = "test-"'
    "policyDocument": [
        {
            "parseJSON": {}
        },
        {
            "addKeys": {
                "entries": [
                    {
                        "key": "metadata.transformed_in",
                        "value": "CloudWatchLogs"
                    }
                ]
            }
        },
        {
            "trimString": {
                "withKeys": [
                    "status"
                ]
            }
        },
        {
            "lowerCaseString": {
                "withKeys": [
                    "status"
                ]
            }
        }
    ]
        ]
    }
```

#### Sample Response
<a name="API_PutDataProtectionPolicy_Example_2_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
```

### To create a field index policy
<a name="API_PutDataProtectionPolicy_Example_3"></a>

The following example creates an account-level field index policy that is scoped to log groups that have names that begin with `test`. The policy indexed two fields in these log groups, `RequestId` and `TransactionId` 

#### Sample Request
<a name="API_PutDataProtectionPolicy_Example_3_Request"></a>

```
{
    "policyName": "my_indexing_account_policy",
    "policyType": "FIELD_INDEX_POLICY",
    "policyDocument": {
        "Fields": ["RequestId", "TransactionId"]
    },
    "selectionCriteria": 'LogGroupNamePrefix = "test"'
}
```

## See Also
<a name="API_PutDataProtectionPolicy_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/PutDataProtectionPolicy) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/PutDataProtectionPolicy) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/PutDataProtectionPolicy) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/PutDataProtectionPolicy) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/PutDataProtectionPolicy) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/PutDataProtectionPolicy) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/PutDataProtectionPolicy) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/PutDataProtectionPolicy) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/PutDataProtectionPolicy) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/PutDataProtectionPolicy) 

# PutDeliveryDestination
<a name="API_PutDeliveryDestination"></a>

Creates or updates a logical *delivery destination*. A delivery destination is an AWS resource that represents an AWS service that logs can be sent to. CloudWatch Logs, Amazon S3, and Firehose are supported as logs delivery destinations and X-Ray as the trace delivery destination.

To configure logs delivery between a supported AWS service and a destination, you must do the following:
+ Create a delivery source, which is a logical object that represents the resource that is actually sending the logs. For more information, see [PutDeliverySource](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliverySource.html).
+ Use `PutDeliveryDestination` to create a *delivery destination* in the same account of the actual delivery destination. The delivery destination that you create is a logical object that represents the actual delivery destination. 
+ If you are delivering logs cross-account, you must use [PutDeliveryDestinationPolicy](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliveryDestinationPolicy.html) in the destination account to assign an IAM policy to the destination. This policy allows delivery to that destination. 
+ Use `CreateDelivery` to create a *delivery* by pairing exactly one delivery source and one delivery destination. For more information, see [CreateDelivery](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateDelivery.html). 

You can configure a single delivery source to send logs to multiple destinations by creating multiple deliveries. You can also create multiple deliveries to configure multiple delivery sources to send logs to the same delivery destination.

Only some AWS services support being configured as a delivery source. These services are listed as **Supported [V2 Permissions]** in the table at [Enabling logging from AWS services.](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html) 

If you use this operation to update an existing delivery destination, all the current delivery destination parameters are overwritten with the new parameter values that you specify.

## Request Syntax
<a name="API_PutDeliveryDestination_RequestSyntax"></a>

```
{
   "deliveryDestinationConfiguration": { 
      "destinationResourceArn": "string"
   },
   "deliveryDestinationType": "string",
   "name": "string",
   "outputFormat": "string",
   "tags": { 
      "string" : "string" 
   }
}
```

## Request Parameters
<a name="API_PutDeliveryDestination_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [deliveryDestinationConfiguration](#API_PutDeliveryDestination_RequestSyntax) **   <a name="CWL-PutDeliveryDestination-request-deliveryDestinationConfiguration"></a>
A structure that contains the ARN of the AWS resource that will receive the logs.  
 `deliveryDestinationConfiguration` is required for CloudWatch Logs, Amazon S3, Firehose log delivery destinations and not required for X-Ray trace delivery destinations. `deliveryDestinationType` is needed for X-Ray trace delivery destinations but not required for other logs delivery destinations.
Type: [DeliveryDestinationConfiguration](API_DeliveryDestinationConfiguration.md) object  
Required: No

 ** [deliveryDestinationType](#API_PutDeliveryDestination_RequestSyntax) **   <a name="CWL-PutDeliveryDestination-request-deliveryDestinationType"></a>
The type of delivery destination. This parameter specifies the target service where log data will be delivered. Valid values include:  
+  `S3` - Amazon S3 for long-term storage and analytics
+  `CWL` - CloudWatch Logs for centralized log management
+  `FH` - Amazon Kinesis Data Firehose for real-time data streaming
+  `XRAY` - AWS X-Ray for distributed tracing and application monitoring
The delivery destination type determines the format and configuration options available for log delivery.  
Type: String  
Valid Values: `S3 | CWL | FH | XRAY`   
Required: No

 ** [name](#API_PutDeliveryDestination_RequestSyntax) **   <a name="CWL-PutDeliveryDestination-request-name"></a>
A name for this delivery destination. This name must be unique for all delivery destinations in your account.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 60.  
Pattern: `[\w-]*`   
Required: Yes

 ** [outputFormat](#API_PutDeliveryDestination_RequestSyntax) **   <a name="CWL-PutDeliveryDestination-request-outputFormat"></a>
The format for the logs that this delivery destination will receive.  
Type: String  
Valid Values: `json | plain | w3c | raw | parquet`   
Required: No

 ** [tags](#API_PutDeliveryDestination_RequestSyntax) **   <a name="CWL-PutDeliveryDestination-request-tags"></a>
An optional list of key-value pairs to associate with the resource.  
For more information about tagging, see [Tagging AWS resources](https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html)   
Type: String to string map  
Map Entries: Maximum number of 50 items.  
Key Length Constraints: Minimum length of 1. Maximum length of 128.  
Key Pattern: `^([\p{L}\p{Z}\p{N}_.:/=+\-@]+)$`   
Value Length Constraints: Maximum length of 256.  
Value Pattern: `^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$`   
Required: No

## Response Syntax
<a name="API_PutDeliveryDestination_ResponseSyntax"></a>

```
{
   "deliveryDestination": { 
      "arn": "string",
      "deliveryDestinationConfiguration": { 
         "destinationResourceArn": "string"
      },
      "deliveryDestinationType": "string",
      "name": "string",
      "outputFormat": "string",
      "tags": { 
         "string" : "string" 
      }
   }
}
```

## Response Elements
<a name="API_PutDeliveryDestination_ResponseElements"></a>

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

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

 ** [deliveryDestination](#API_PutDeliveryDestination_ResponseSyntax) **   <a name="CWL-PutDeliveryDestination-response-deliveryDestination"></a>
A structure containing information about the delivery destination that you just created or updated.  
Type: [DeliveryDestination](API_DeliveryDestination.md) object

## Errors
<a name="API_PutDeliveryDestination_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ConflictException **   
This operation attempted to create a resource that already exists.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
The specified resource does not exist.  
HTTP Status Code: 400

 ** ServiceQuotaExceededException **   
This request exceeds a service quota.  
HTTP Status Code: 400

 ** ServiceUnavailableException **   
The service cannot complete the request.  
HTTP Status Code: 500

 ** ThrottlingException **   
The request was throttled because of quota limits.  
HTTP Status Code: 400

 ** ValidationException **   
One of the parameters for the request is not valid.  
HTTP Status Code: 400

## See Also
<a name="API_PutDeliveryDestination_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/PutDeliveryDestination) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/PutDeliveryDestination) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/PutDeliveryDestination) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/PutDeliveryDestination) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/PutDeliveryDestination) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/PutDeliveryDestination) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/PutDeliveryDestination) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/PutDeliveryDestination) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/PutDeliveryDestination) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/PutDeliveryDestination) 

# PutDeliveryDestinationPolicy
<a name="API_PutDeliveryDestinationPolicy"></a>

Creates and assigns an IAM policy that grants permissions to CloudWatch Logs to deliver logs cross-account to a specified destination in this account. To configure the delivery of logs from an AWS service in another account to a logs delivery destination in the current account, you must do the following:
+ Create a delivery source, which is a logical object that represents the resource that is actually sending the logs. For more information, see [PutDeliverySource](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliverySource.html).
+ Create a *delivery destination*, which is a logical object that represents the actual delivery destination. For more information, see [PutDeliveryDestination](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliveryDestination.html).
+ Use this operation in the destination account to assign an IAM policy to the destination. This policy allows delivery to that destination. 
+ Create a *delivery* by pairing exactly one delivery source and one delivery destination. For more information, see [CreateDelivery](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateDelivery.html).

Only some AWS services support being configured as a delivery source. These services are listed as **Supported [V2 Permissions]** in the table at [Enabling logging from AWS services.](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html) 

The contents of the policy must include two statements. One statement enables general logs delivery, and the other allows delivery to the chosen destination. See the examples for the needed policies.

## Request Syntax
<a name="API_PutDeliveryDestinationPolicy_RequestSyntax"></a>

```
{
   "deliveryDestinationName": "string",
   "deliveryDestinationPolicy": "string"
}
```

## Request Parameters
<a name="API_PutDeliveryDestinationPolicy_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [deliveryDestinationName](#API_PutDeliveryDestinationPolicy_RequestSyntax) **   <a name="CWL-PutDeliveryDestinationPolicy-request-deliveryDestinationName"></a>
The name of the delivery destination to assign this policy to.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 60.  
Pattern: `[\w-]*`   
Required: Yes

 ** [deliveryDestinationPolicy](#API_PutDeliveryDestinationPolicy_RequestSyntax) **   <a name="CWL-PutDeliveryDestinationPolicy-request-deliveryDestinationPolicy"></a>
The contents of the policy.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 51200.  
Required: Yes

## Response Syntax
<a name="API_PutDeliveryDestinationPolicy_ResponseSyntax"></a>

```
{
   "policy": { 
      "deliveryDestinationPolicy": "string"
   }
}
```

## Response Elements
<a name="API_PutDeliveryDestinationPolicy_ResponseElements"></a>

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

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

 ** [policy](#API_PutDeliveryDestinationPolicy_ResponseSyntax) **   <a name="CWL-PutDeliveryDestinationPolicy-response-policy"></a>
The contents of the policy that you just created.  
Type: [Policy](API_Policy.md) object

## Errors
<a name="API_PutDeliveryDestinationPolicy_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ConflictException **   
This operation attempted to create a resource that already exists.  
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

 ** ValidationException **   
One of the parameters for the request is not valid.  
HTTP Status Code: 400

## Examples
<a name="API_PutDeliveryDestinationPolicy_Examples"></a>

### Policy to use with PutDeliveryDestination
<a name="API_PutDeliveryDestinationPolicy_Example_1"></a>

The following example creates a policy that grants permission to CloudWatch Logs to deliver logs cross-account to a destination in the current account.

#### Sample Request
<a name="API_PutDeliveryDestinationPolicy_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.PutDeliveryDestinationPolicy
{
   "deliveryDestinationName": "DeliveryDestinationName",
   "deliveryDestinationPolicy": "{
      "Version": "2012-10-17",		 	 	 
      "Statement": [
        {
          "Sid": "AllowLogDeliveryActions",
          "Effect": "Allow",
          "Principal": {
            "AWS": "arn:aws:iam::AccountID:root"
          },
          "Action": "logs:CreateDelivery",
          "Resource": [
            "arn:aws:logs:us-east-1:AccountID:delivery-source:*",
            "arn:aws:logs:us-east-1:AccountID:delivery:*",
            "arn:aws:logs:us-east-1:AccountID:delivery-destination:*"
          ]
        }
      ]
    }"
}
```

## See Also
<a name="API_PutDeliveryDestinationPolicy_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/PutDeliveryDestinationPolicy) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/PutDeliveryDestinationPolicy) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/PutDeliveryDestinationPolicy) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/PutDeliveryDestinationPolicy) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/PutDeliveryDestinationPolicy) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/PutDeliveryDestinationPolicy) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/PutDeliveryDestinationPolicy) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/PutDeliveryDestinationPolicy) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/PutDeliveryDestinationPolicy) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/PutDeliveryDestinationPolicy) 

# PutDeliverySource
<a name="API_PutDeliverySource"></a>

Creates or updates a logical *delivery source*. A delivery source represents an AWS resource that sends logs to an logs delivery destination. The destination can be CloudWatch Logs, Amazon S3, Firehose or X-Ray for sending traces.

To configure logs delivery between a delivery destination and an AWS service that is supported as a delivery source, you must do the following:
+ Use `PutDeliverySource` to create a delivery source, which is a logical object that represents the resource that is actually sending the logs. 
+ Use `PutDeliveryDestination` to create a *delivery destination*, which is a logical object that represents the actual delivery destination. For more information, see [PutDeliveryDestination](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliveryDestination.html).
+ If you are delivering logs cross-account, you must use [PutDeliveryDestinationPolicy](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliveryDestinationPolicy.html) in the destination account to assign an IAM policy to the destination. This policy allows delivery to that destination. 
+ Use `CreateDelivery` to create a *delivery* by pairing exactly one delivery source and one delivery destination. For more information, see [CreateDelivery](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateDelivery.html). 

You can configure a single delivery source to send logs to multiple destinations by creating multiple deliveries. You can also create multiple deliveries to configure multiple delivery sources to send logs to the same delivery destination.

Only some AWS services support being configured as a delivery source. These services are listed as **Supported [V2 Permissions]** in the table at [Enabling logging from AWS services.](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html) 

If you use this operation to update an existing delivery source, all the current delivery source parameters are overwritten with the new parameter values that you specify.

## Request Syntax
<a name="API_PutDeliverySource_RequestSyntax"></a>

```
{
   "logType": "string",
   "name": "string",
   "resourceArn": "string",
   "tags": { 
      "string" : "string" 
   }
}
```

## Request Parameters
<a name="API_PutDeliverySource_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [logType](#API_PutDeliverySource_RequestSyntax) **   <a name="CWL-PutDeliverySource-request-logType"></a>
Defines the type of log that the source is sending.  
+ For Amazon Bedrock Agents, the valid values are `APPLICATION_LOGS` and `EVENT_LOGS`.
+ For Amazon Bedrock Knowledge Bases, the valid value is `APPLICATION_LOGS`.
+ For Amazon Bedrock AgentCore Runtime, the valid values are `APPLICATION_LOGS`, `USAGE_LOGS` and `TRACES`.
+ For Amazon Bedrock AgentCore Tools, the valid values are `APPLICATION_LOGS`, `USAGE_LOGS` and `TRACES`.
+ For Amazon Bedrock AgentCore Identity, the valid values are `APPLICATION_LOGS` and `TRACES`.
+ For Amazon Bedrock AgentCore Memory, the valid values are `APPLICATION_LOGS` and `TRACES`.
+ For Amazon Bedrock AgentCore Gateway, the valid values are `APPLICATION_LOGS` and `TRACES`.
+ For CloudFront, the valid value is `ACCESS_LOGS`.
+ For DevOps Agent, the valid value is `APPLICATION_LOGS`.
+ For Amazon CodeWhisperer, the valid value is `EVENT_LOGS`.
+ For Elemental MediaPackage, the valid values are `EGRESS_ACCESS_LOGS` and `INGRESS_ACCESS_LOGS`.
+ For Elemental MediaTailor, the valid values are `AD_DECISION_SERVER_LOGS`, `MANIFEST_SERVICE_LOGS`, and `TRANSCODE_LOGS`.
+ For Amazon EKS Auto Mode, the valid values are `AUTO_MODE_BLOCK_STORAGE_LOGS`, `AUTO_MODE_COMPUTE_LOGS`, `AUTO_MODE_IPAM_LOGS`, and `AUTO_MODE_LOAD_BALANCING_LOGS`.
+ For AWS Entity Resolution, the valid value is `WORKFLOW_LOGS`.
+ For IAM Identity Center, the valid value is `ERROR_LOGS`.
+ For Network Firewall Proxy, the valid values are `ALERT_LOGS`, `ALLOW_LOGS`, and `DENY_LOGS`.
+ For Network Load Balancer, the valid value is `NLB_ACCESS_LOGS`.
+ For AWS PCS, the valid values are `PCS_SCHEDULER_LOGS` and `PCS_JOBCOMP_LOGS`.
+ For Quick, the valid values are `CHAT_LOGS` and `FEEDBACK_LOGS`.
+ For AWS RTB Fabric, the valid values is `APPLICATION_LOGS`.
+ For Amazon Q, the valid values are `EVENT_LOGS` and `SYNC_JOB_LOGS`.
+ For AWS Security Hub CSPM, the valid value is `SECURITY_FINDING_LOGS`.
+ For AWS Security Hub, the valid value is `SECURITY_FINDING_LOGS`.
+ For Amazon SES mail manager, the valid values are `APPLICATION_LOGS` and `TRAFFIC_POLICY_DEBUG_LOGS`.
+ For Amazon WorkMail, the valid values are `ACCESS_CONTROL_LOGS`, `AUTHENTICATION_LOGS`, `WORKMAIL_AVAILABILITY_PROVIDER_LOGS`, `WORKMAIL_MAILBOX_ACCESS_LOGS`, and `WORKMAIL_PERSONAL_ACCESS_TOKEN_LOGS`.
+ For Amazon VPC Route Server, the valid value is `EVENT_LOGS`.
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 255.  
Pattern: `[\w]*`   
Required: Yes

 ** [name](#API_PutDeliverySource_RequestSyntax) **   <a name="CWL-PutDeliverySource-request-name"></a>
A name for this delivery source. This name must be unique for all delivery sources in your account.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 60.  
Pattern: `[\w-]*`   
Required: Yes

 ** [resourceArn](#API_PutDeliverySource_RequestSyntax) **   <a name="CWL-PutDeliverySource-request-resourceArn"></a>
The ARN of the AWS resource that is generating and sending logs. For example, `arn:aws:workmail:us-east-1:123456789012:organization/m-1234EXAMPLEabcd1234abcd1234abcd1234`   
For the `SECURITY_FINDING_LOGS` logType, use a wildcard ARN for the hub resource. For AWS Security Hub CSPM, use `arn:aws:securityhub:us-east-1:111122223333:hub/*` and for AWS Security Hub, use `arn:aws:securityhub:us-east-1:111122223333:hubv2/*`   
Type: String  
Required: Yes

 ** [tags](#API_PutDeliverySource_RequestSyntax) **   <a name="CWL-PutDeliverySource-request-tags"></a>
An optional list of key-value pairs to associate with the resource.  
For more information about tagging, see [Tagging AWS resources](https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html)   
Type: String to string map  
Map Entries: Maximum number of 50 items.  
Key Length Constraints: Minimum length of 1. Maximum length of 128.  
Key Pattern: `^([\p{L}\p{Z}\p{N}_.:/=+\-@]+)$`   
Value Length Constraints: Maximum length of 256.  
Value Pattern: `^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$`   
Required: No

## Response Syntax
<a name="API_PutDeliverySource_ResponseSyntax"></a>

```
{
   "deliverySource": { 
      "arn": "string",
      "logType": "string",
      "name": "string",
      "resourceArns": [ "string" ],
      "service": "string",
      "tags": { 
         "string" : "string" 
      }
   }
}
```

## Response Elements
<a name="API_PutDeliverySource_ResponseElements"></a>

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

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

 ** [deliverySource](#API_PutDeliverySource_ResponseSyntax) **   <a name="CWL-PutDeliverySource-response-deliverySource"></a>
A structure containing information about the delivery source that was just created or updated.  
Type: [DeliverySource](API_DeliverySource.md) object

## Errors
<a name="API_PutDeliverySource_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ConflictException **   
This operation attempted to create a resource that already exists.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
The specified resource does not exist.  
HTTP Status Code: 400

 ** ServiceQuotaExceededException **   
This request exceeds a service quota.  
HTTP Status Code: 400

 ** ServiceUnavailableException **   
The service cannot complete the request.  
HTTP Status Code: 500

 ** ThrottlingException **   
The request was throttled because of quota limits.  
HTTP Status Code: 400

 ** ValidationException **   
One of the parameters for the request is not valid.  
HTTP Status Code: 400

## See Also
<a name="API_PutDeliverySource_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/PutDeliverySource) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/PutDeliverySource) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/PutDeliverySource) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/PutDeliverySource) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/PutDeliverySource) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/PutDeliverySource) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/PutDeliverySource) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/PutDeliverySource) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/PutDeliverySource) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/PutDeliverySource) 

# PutDestination
<a name="API_PutDestination"></a>

Creates or updates a destination. This operation is used only to create destinations for cross-account subscriptions.

A destination encapsulates a physical resource (such as an Amazon Kinesis stream). With a destination, you can subscribe to a real-time stream of log events for a different account, ingested using [PutLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html).

Through an access policy, a destination controls what is written to it. By default, `PutDestination` does not set any access policy with the destination, which means a cross-account user cannot call [PutSubscriptionFilter](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutSubscriptionFilter.html) against this destination. To enable this, the destination owner must call [PutDestinationPolicy](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDestinationPolicy.html) after `PutDestination`.

To perform a `PutDestination` operation, you must also have the `iam:PassRole` permission.

## Request Syntax
<a name="API_PutDestination_RequestSyntax"></a>

```
{
   "destinationName": "string",
   "roleArn": "string",
   "tags": { 
      "string" : "string" 
   },
   "targetArn": "string"
}
```

## Request Parameters
<a name="API_PutDestination_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [destinationName](#API_PutDestination_RequestSyntax) **   <a name="CWL-PutDestination-request-destinationName"></a>
A name for the destination.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[^:*]*`   
Required: Yes

 ** [roleArn](#API_PutDestination_RequestSyntax) **   <a name="CWL-PutDestination-request-roleArn"></a>
The ARN of an IAM role that grants CloudWatch Logs permissions to call the Amazon Kinesis `PutRecord` operation on the destination stream.  
Type: String  
Length Constraints: Minimum length of 1.  
Required: Yes

 ** [tags](#API_PutDestination_RequestSyntax) **   <a name="CWL-PutDestination-request-tags"></a>
An optional list of key-value pairs to associate with the resource.  
For more information about tagging, see [Tagging AWS resources](https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html)   
Type: String to string map  
Map Entries: Maximum number of 50 items.  
Key Length Constraints: Minimum length of 1. Maximum length of 128.  
Key Pattern: `^([\p{L}\p{Z}\p{N}_.:/=+\-@]+)$`   
Value Length Constraints: Maximum length of 256.  
Value Pattern: `^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$`   
Required: No

 ** [targetArn](#API_PutDestination_RequestSyntax) **   <a name="CWL-PutDestination-request-targetArn"></a>
The ARN of an Amazon Kinesis stream to which to deliver matching log events.  
Type: String  
Length Constraints: Minimum length of 1.  
Required: Yes

## Response Syntax
<a name="API_PutDestination_ResponseSyntax"></a>

```
{
   "destination": { 
      "accessPolicy": "string",
      "arn": "string",
      "creationTime": number,
      "destinationName": "string",
      "roleArn": "string",
      "targetArn": "string"
   }
}
```

## Response Elements
<a name="API_PutDestination_ResponseElements"></a>

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

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

 ** [destination](#API_PutDestination_ResponseSyntax) **   <a name="CWL-PutDestination-response-destination"></a>
The destination.  
Type: [Destination](API_Destination.md) object

## Errors
<a name="API_PutDestination_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
HTTP Status Code: 400

 ** ServiceUnavailableException **   
The service cannot complete the request.  
HTTP Status Code: 500

## Examples
<a name="API_PutDestination_Examples"></a>

### To create or update a destination
<a name="API_PutDestination_Example_1"></a>

The following example creates the specified destination.

#### Sample Request
<a name="API_PutDestination_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.PutDestination
{
  "destinationName": "my-destination",
  "targetArn": "arn:aws:kinesis:us-east-1:123456789012:stream/my-kinesis-stream",
  "roleArn": "arn:aws:iam::123456789012:role/my-subscription-role"
}
```

#### Sample Response
<a name="API_PutDestination_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
  "destination": [
    {
      "destinationName": "my-destination",
      "targetArn": "arn:aws:kinesis:us-east-1:123456789012:stream/my-kinesis-stream",
      "roleArn": "arn:aws:iam::123456789012:role/my-subscription-role",
      "arn": "arn:aws:logs:us-east-1:123456789012:destination:my-destination",
      "creationTime": 1437584472382
    }
  ]
}
```

## See Also
<a name="API_PutDestination_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/PutDestination) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/PutDestination) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/PutDestination) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/PutDestination) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/PutDestination) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/PutDestination) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/PutDestination) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/PutDestination) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/PutDestination) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/PutDestination) 

# PutDestinationPolicy
<a name="API_PutDestinationPolicy"></a>

Creates or updates an access policy associated with an existing destination. An access policy is an [IAM policy document](https://docs.aws.amazon.com/IAM/latest/UserGuide/policies_overview.html) that is used to authorize claims to register a subscription filter against a given destination.

## Request Syntax
<a name="API_PutDestinationPolicy_RequestSyntax"></a>

```
{
   "accessPolicy": "string",
   "destinationName": "string",
   "forceUpdate": boolean
}
```

## Request Parameters
<a name="API_PutDestinationPolicy_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [accessPolicy](#API_PutDestinationPolicy_RequestSyntax) **   <a name="CWL-PutDestinationPolicy-request-accessPolicy"></a>
An IAM policy document that authorizes cross-account users to deliver their log events to the associated destination. This can be up to 5120 bytes.  
Type: String  
Length Constraints: Minimum length of 1.  
Required: Yes

 ** [destinationName](#API_PutDestinationPolicy_RequestSyntax) **   <a name="CWL-PutDestinationPolicy-request-destinationName"></a>
A name for an existing destination.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[^:*]*`   
Required: Yes

 ** [forceUpdate](#API_PutDestinationPolicy_RequestSyntax) **   <a name="CWL-PutDestinationPolicy-request-forceUpdate"></a>
Specify true if you are updating an existing destination policy to grant permission to an organization ID instead of granting permission to individual AWS accounts. Before you update a destination policy this way, you must first update the subscription filters in the accounts that send logs to this destination. If you do not, the subscription filters might stop working. By specifying `true` for `forceUpdate`, you are affirming that you have already updated the subscription filters. For more information, see [ Updating an existing cross-account subscription](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Cross-Account-Log_Subscription-Update.html)   
If you omit this parameter, the default of `false` is used.  
Type: Boolean  
Required: No

## Response Elements
<a name="API_PutDestinationPolicy_ResponseElements"></a>

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

## Errors
<a name="API_PutDestinationPolicy_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
HTTP Status Code: 400

 ** ServiceUnavailableException **   
The service cannot complete the request.  
HTTP Status Code: 500

## Examples
<a name="API_PutDestinationPolicy_Examples"></a>

### To create or update an access policy of a destination
<a name="API_PutDestinationPolicy_Example_1"></a>

The following example updates the access policy of the specified destination.

#### Sample Request
<a name="API_PutDestinationPolicy_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.PutDestinationPolicy
{
  "destinationName": "my-destination",
  "accessPolicy": "{ \"Version\": \"2012-10-17\", \"Statement\": [{ \"Effect\": \"Allow\", \"Principal\": { \"AWS\": \"111111111111\"}, \"Action\": \"logs:PutSubscriptionFilter\",\"Resource\": \"arn:aws:logs:us-east-1:123456789012:destination:my-destination\"}]}"
}
```

#### Sample Response
<a name="API_PutDestinationPolicy_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
```

## See Also
<a name="API_PutDestinationPolicy_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/PutDestinationPolicy) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/PutDestinationPolicy) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/PutDestinationPolicy) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/PutDestinationPolicy) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/PutDestinationPolicy) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/PutDestinationPolicy) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/PutDestinationPolicy) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/PutDestinationPolicy) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/PutDestinationPolicy) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/PutDestinationPolicy) 

# PutIndexPolicy
<a name="API_PutIndexPolicy"></a>

Creates or updates a *field index policy* for the specified log group. Only log groups in the Standard log class support field index policies. For more information about log classes, see [Log classes](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch_Logs_Log_Classes.html).

You can use field index policies to create *field indexes* on fields found in log events in the log group. Creating field indexes speeds up and lowers the costs for CloudWatch Logs Insights queries that reference those field indexes, because these queries attempt to skip the processing of log events that are known to not match the indexed field. Good fields to index are fields that you often need to query for and fields or values that match only a small fraction of the total log events. Common examples of indexes include request ID, session ID, userID, and instance IDs. For more information, see [Create field indexes to improve query performance and reduce costs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatchLogs-Field-Indexing.html).

You can configure indexed fields as *facets* to enable interactive exploration and filtering of your logs in the CloudWatch Logs Insights console. Facets allow you to view value distributions and counts for indexed fields without running queries. When you create a field index, you can optionally set it as a facet to enable this interactive analysis capability. For more information, see [Use facets to group and explore logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatchLogs-Facets.html).

To find the fields that are in your log group events, use the [GetLogGroupFields](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_GetLogGroupFields.html) operation.

For example, suppose you have created a field index for `requestId`. Then, any CloudWatch Logs Insights query on that log group that includes `requestId = value ` or `requestId IN [value, value, ...]` will process fewer log events to reduce costs, and have improved performance.

CloudWatch Logs provides default field indexes for all log groups in the Standard log class. Default field indexes are automatically available for the following fields: 
+  `@logStream` 
+  `@aws.region` 
+  `@aws.account` 
+  `@source.log` 
+  `traceId` 

Default field indexes are in addition to any custom field indexes you define within your policy. Default field indexes are not counted towards your field index quota. 

Each index policy has the following quotas and restrictions:
+ As many as 20 fields can be included in the policy.
+ Each field name can include as many as 100 characters.

Matches of log events to the names of indexed fields are case-sensitive. For example, a field index of `RequestId` won't match a log event containing `requestId`.

Log group-level field index policies created with `PutIndexPolicy` override account-level field index policies created with [PutAccountPolicy](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutAccountPolicy.html) that apply to log groups. If you use `PutIndexPolicy` to create a field index policy for a log group, that log group uses only that policy for log group-level indexing, including any facet configurations. The log group ignores any account-wide field index policy that applies to log groups, but data source-based account policies may still apply.

## Request Syntax
<a name="API_PutIndexPolicy_RequestSyntax"></a>

```
{
   "logGroupIdentifier": "string",
   "policyDocument": "string"
}
```

## Request Parameters
<a name="API_PutIndexPolicy_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [logGroupIdentifier](#API_PutIndexPolicy_RequestSyntax) **   <a name="CWL-PutIndexPolicy-request-logGroupIdentifier"></a>
Specify either the log group name or log group ARN to apply this field index policy to. If you specify an ARN, use the format arn:aws:logs:*region*:*account-id*:log-group:*log\$1group\$1name* Don't include an \$1 at the end.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Pattern: `[\w#+=/:,.@-]*`   
Required: Yes

 ** [policyDocument](#API_PutIndexPolicy_RequestSyntax) **   <a name="CWL-PutIndexPolicy-request-policyDocument"></a>
The index policy document, in JSON format. The following is an example of an index policy document that creates indexes with different types.  
 `"policyDocument": "{"Fields": [ "TransactionId" ], "FieldsV2": {"RequestId": {"type": "FIELD_INDEX"}, "APIName": {"type": "FACET"}, "StatusCode": {"type": "FACET"}}}"`   
You can use `FieldsV2` to specify the type for each field. Supported types are `FIELD_INDEX` and `FACET`. Field names within `Fields` and `FieldsV2` must be mutually exclusive.  
The policy document must include at least one field index. For more information about the fields that can be included and other restrictions, see [Field index syntax and quotas](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatchLogs-Field-Indexing-Syntax.html).  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 51200.  
Required: Yes

## Response Syntax
<a name="API_PutIndexPolicy_ResponseSyntax"></a>

```
{
   "indexPolicy": { 
      "lastUpdateTime": number,
      "logGroupIdentifier": "string",
      "policyDocument": "string",
      "policyName": "string",
      "source": "string"
   }
}
```

## Response Elements
<a name="API_PutIndexPolicy_ResponseElements"></a>

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

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

 ** [indexPolicy](#API_PutIndexPolicy_ResponseSyntax) **   <a name="CWL-PutIndexPolicy-response-indexPolicy"></a>
The index policy that you just created or updated.  
Type: [IndexPolicy](API_IndexPolicy.md) object

## Errors
<a name="API_PutIndexPolicy_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** LimitExceededException **   
You have reached the maximum number of resources that can be created.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
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
<a name="API_PutIndexPolicy_Examples"></a>

### Create index policy for a log group
<a name="API_PutIndexPolicy_Example_1"></a>

The following example creates an index policy that indexes two fields, `RequestId` and `TransactionId`.

#### Sample Request
<a name="API_PutIndexPolicy_Example_1_Request"></a>

```
{
    "logGroupIdentifier": "service-logs",
    "policyDocument": {
        "Fields": ["RequestId", "TransactionId"]
    }
}
```

## See Also
<a name="API_PutIndexPolicy_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/PutIndexPolicy) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/PutIndexPolicy) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/PutIndexPolicy) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/PutIndexPolicy) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/PutIndexPolicy) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/PutIndexPolicy) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/PutIndexPolicy) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/PutIndexPolicy) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/PutIndexPolicy) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/PutIndexPolicy) 

# PutIntegration
<a name="API_PutIntegration"></a>

Creates an integration between CloudWatch Logs and another service in this account. Currently, only integrations with OpenSearch Service are supported, and currently you can have only one integration in your account.

Integrating with OpenSearch Service makes it possible for you to create curated vended logs dashboards, powered by OpenSearch Service analytics. For more information, see [Vended log dashboards powered by Amazon OpenSearch Service](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatchLogs-OpenSearch-Dashboards.html).

You can use this operation only to create a new integration. You can't modify an existing integration.

## Request Syntax
<a name="API_PutIntegration_RequestSyntax"></a>

```
{
   "integrationName": "string",
   "integrationType": "string",
   "resourceConfig": { ... }
}
```

## Request Parameters
<a name="API_PutIntegration_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [integrationName](#API_PutIntegration_RequestSyntax) **   <a name="CWL-PutIntegration-request-integrationName"></a>
A name for the integration.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 50.  
Pattern: `[\.\-_/#A-Za-z0-9]+`   
Required: Yes

 ** [integrationType](#API_PutIntegration_RequestSyntax) **   <a name="CWL-PutIntegration-request-integrationType"></a>
The type of integration. Currently, the only supported type is `OPENSEARCH`.  
Type: String  
Valid Values: `OPENSEARCH`   
Required: Yes

 ** [resourceConfig](#API_PutIntegration_RequestSyntax) **   <a name="CWL-PutIntegration-request-resourceConfig"></a>
A structure that contains configuration information for the integration that you are creating.  
Type: [ResourceConfig](API_ResourceConfig.md) object  
 **Note: **This object is a Union. Only one member of this object can be specified or returned.  
Required: Yes

## Response Syntax
<a name="API_PutIntegration_ResponseSyntax"></a>

```
{
   "integrationName": "string",
   "integrationStatus": "string"
}
```

## Response Elements
<a name="API_PutIntegration_ResponseElements"></a>

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

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

 ** [integrationName](#API_PutIntegration_ResponseSyntax) **   <a name="CWL-PutIntegration-response-integrationName"></a>
The name of the integration that you just created.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 50.  
Pattern: `[\.\-_/#A-Za-z0-9]+` 

 ** [integrationStatus](#API_PutIntegration_ResponseSyntax) **   <a name="CWL-PutIntegration-response-integrationStatus"></a>
The status of the integration that you just created.  
After you create an integration, it takes a few minutes to complete. During this time, you'll see the status as `PROVISIONING`.  
Type: String  
Valid Values: `PROVISIONING | ACTIVE | FAILED` 

## Errors
<a name="API_PutIntegration_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** LimitExceededException **   
You have reached the maximum number of resources that can be created.  
HTTP Status Code: 400

 ** ServiceUnavailableException **   
The service cannot complete the request.  
HTTP Status Code: 500

 ** ValidationException **   
One of the parameters for the request is not valid.  
HTTP Status Code: 400

## See Also
<a name="API_PutIntegration_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/PutIntegration) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/PutIntegration) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/PutIntegration) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/PutIntegration) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/PutIntegration) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/PutIntegration) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/PutIntegration) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/PutIntegration) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/PutIntegration) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/PutIntegration) 

# PutLogEvents
<a name="API_PutLogEvents"></a>

Uploads a batch of log events to the specified log stream.

**Important**  
The sequence token is now ignored in `PutLogEvents` actions. `PutLogEvents` actions are always accepted and never return `InvalidSequenceTokenException` or `DataAlreadyAcceptedException` even if the sequence token is not valid. You can use parallel `PutLogEvents` actions on the same log stream. 

The batch of events must satisfy the following constraints:
+ The maximum batch size is 1,048,576 bytes. This size is calculated as the sum of all event messages in UTF-8, plus 26 bytes for each log event.
+ Events more than 2 hours in the future are rejected while processing remaining valid events.
+ Events older than 14 days or preceding the log group's retention period are rejected while processing remaining valid events.
+ The log events in the batch must be in chronological order by their timestamp. The timestamp is the time that the event occurred, expressed as the number of milliseconds after `Jan 1, 1970 00:00:00 UTC`. (In AWS Tools for PowerShell and the AWS SDK for .NET, the timestamp is specified in .NET format: `yyyy-mm-ddThh:mm:ss`. For example, `2017-09-15T13:45:30`.) 
+  A batch of log events in a single request must be in a chronological order. Otherwise, the operation fails.
+ Each log event can be no larger than 1 MB.
+ The maximum number of log events in a batch is 10,000.
+ For valid events (within 14 days in the past to 2 hours in future), the time span in a single batch cannot exceed 24 hours. Otherwise, the operation fails.

**Important**  
The quota of five requests per second per log stream has been removed. Instead, `PutLogEvents` actions are throttled based on a per-second per-account quota. You can request an increase to the per-second throttling quota by using the Service Quotas service.

If a call to `PutLogEvents` returns "UnrecognizedClientException" the most likely cause is a non-valid AWS access key ID or secret key. 

## Request Syntax
<a name="API_PutLogEvents_RequestSyntax"></a>

```
{
   "entity": { 
      "attributes": { 
         "string" : "string" 
      },
      "keyAttributes": { 
         "string" : "string" 
      }
   },
   "logEvents": [ 
      { 
         "message": "string",
         "timestamp": number
      }
   ],
   "logGroupName": "string",
   "logStreamName": "string",
   "sequenceToken": "string"
}
```

## Request Parameters
<a name="API_PutLogEvents_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [entity](#API_PutLogEvents_RequestSyntax) **   <a name="CWL-PutLogEvents-request-entity"></a>
The entity associated with the log events.  
Type: [Entity](API_Entity.md) object  
Required: No

 ** [logEvents](#API_PutLogEvents_RequestSyntax) **   <a name="CWL-PutLogEvents-request-logEvents"></a>
The log events.  
Type: Array of [InputLogEvent](API_InputLogEvent.md) objects  
Array Members: Minimum number of 1 item. Maximum number of 10000 items.  
Required: Yes

 ** [logGroupName](#API_PutLogEvents_RequestSyntax) **   <a name="CWL-PutLogEvents-request-logGroupName"></a>
The name of the log group.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[\.\-_/#A-Za-z0-9]+`   
Required: Yes

 ** [logStreamName](#API_PutLogEvents_RequestSyntax) **   <a name="CWL-PutLogEvents-request-logStreamName"></a>
The name of the log stream.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[^:*]*`   
Required: Yes

 ** [sequenceToken](#API_PutLogEvents_RequestSyntax) **   <a name="CWL-PutLogEvents-request-sequenceToken"></a>
The sequence token obtained from the response of the previous `PutLogEvents` call.  
The `sequenceToken` parameter is now ignored in `PutLogEvents` actions. `PutLogEvents` actions are now accepted and never return `InvalidSequenceTokenException` or `DataAlreadyAcceptedException` even if the sequence token is not valid.
Type: String  
Length Constraints: Minimum length of 1.  
Required: No

## Response Syntax
<a name="API_PutLogEvents_ResponseSyntax"></a>

```
{
   "nextSequenceToken": "string",
   "rejectedEntityInfo": { 
      "errorType": "string"
   },
   "rejectedLogEventsInfo": { 
      "expiredLogEventEndIndex": number,
      "tooNewLogEventStartIndex": number,
      "tooOldLogEventEndIndex": number
   }
}
```

## Response Elements
<a name="API_PutLogEvents_ResponseElements"></a>

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

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

 ** [nextSequenceToken](#API_PutLogEvents_ResponseSyntax) **   <a name="CWL-PutLogEvents-response-nextSequenceToken"></a>
The next sequence token.  
This field has been deprecated.  
The sequence token is now ignored in `PutLogEvents` actions. `PutLogEvents` actions are always accepted even if the sequence token is not valid. You can use parallel `PutLogEvents` actions on the same log stream and you do not need to wait for the response of a previous `PutLogEvents` action to obtain the `nextSequenceToken` value.
Type: String  
Length Constraints: Minimum length of 1.

 ** [rejectedEntityInfo](#API_PutLogEvents_ResponseSyntax) **   <a name="CWL-PutLogEvents-response-rejectedEntityInfo"></a>
Information about why the entity is rejected when calling `PutLogEvents`. Only returned when the entity is rejected.  
When the entity is rejected, the events may still be accepted.
Type: [RejectedEntityInfo](API_RejectedEntityInfo.md) object

 ** [rejectedLogEventsInfo](#API_PutLogEvents_ResponseSyntax) **   <a name="CWL-PutLogEvents-response-rejectedLogEventsInfo"></a>
The rejected events.  
Type: [RejectedLogEventsInfo](API_RejectedLogEventsInfo.md) object

## Errors
<a name="API_PutLogEvents_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** DataAlreadyAcceptedException **   
The event was already logged.  
 `PutLogEvents` actions are now always accepted and never return `DataAlreadyAcceptedException` regardless of whether a given batch of log events has already been accepted. 
HTTP Status Code: 400

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** InvalidSequenceTokenException **   
The sequence token is not valid. You can get the correct sequence token in the `expectedSequenceToken` field in the `InvalidSequenceTokenException` message.   
 `PutLogEvents` actions are now always accepted and never return `InvalidSequenceTokenException` regardless of receiving an invalid sequence token. 
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

 ** UnrecognizedClientException **   
The most likely cause is an AWS access key ID or secret key that's not valid.  
HTTP Status Code: 400

## Examples
<a name="API_PutLogEvents_Examples"></a>

### To upload log events into a log stream
<a name="API_PutLogEvents_Example_1"></a>

The following example uploads the specified log events to the specified log stream.

#### Sample Request
<a name="API_PutLogEvents_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.PutLogEvents
{
  "logGroupName": "my-log-group",
  "logStreamName": "my-log-stream",
  "logEvents": [
    {
      "timestamp": 1396035378988,
      "message": "Example event 1"
    },
    {
      "timestamp": 1396035378988,
      "message": "Example event 2"
    },
    {
      "timestamp": 1396035378989,
      "message": "Example event 3"
    }
  ]
}
```

#### Sample Response
<a name="API_PutLogEvents_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
  "nextSequenceToken": "49536701251539826331025683274032969384950891766572122113"
}
```

## See Also
<a name="API_PutLogEvents_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/PutLogEvents) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/PutLogEvents) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/PutLogEvents) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/PutLogEvents) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/PutLogEvents) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/PutLogEvents) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/PutLogEvents) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/PutLogEvents) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/PutLogEvents) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/PutLogEvents) 

# PutLogGroupDeletionProtection
<a name="API_PutLogGroupDeletionProtection"></a>

Enables or disables deletion protection for the specified log group. When enabled on a log group, deletion protection blocks all deletion operations until it is explicitly disabled.

For information about the parameters that are common to all actions, see [Common Parameters](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/CommonParameters.html).

## Request Syntax
<a name="API_PutLogGroupDeletionProtection_RequestSyntax"></a>

```
{
   "deletionProtectionEnabled": boolean,
   "logGroupIdentifier": "string"
}
```

## Request Parameters
<a name="API_PutLogGroupDeletionProtection_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [deletionProtectionEnabled](#API_PutLogGroupDeletionProtection_RequestSyntax) **   <a name="CWL-PutLogGroupDeletionProtection-request-deletionProtectionEnabled"></a>
Whether to enable deletion protection.  
Type: Boolean  
Required: Yes  
Type: Boolean  
Required: Yes

 ** [logGroupIdentifier](#API_PutLogGroupDeletionProtection_RequestSyntax) **   <a name="CWL-PutLogGroupDeletionProtection-request-logGroupIdentifier"></a>
The name or ARN of the log group.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[\.\-_/#A-Za-z0-9]+`   
Required: Yes  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Pattern: `[\w#+=/:,.@-]*`   
Required: Yes

## Response Elements
<a name="API_PutLogGroupDeletionProtection_ResponseElements"></a>

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

## Errors
<a name="API_PutLogGroupDeletionProtection_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have sufficient permissions to perform this action.  
HTTP Status Code: 400

 ** InvalidOperationException **   
The operation is not valid on the specified resource.  
HTTP Status Code: 400

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
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
<a name="API_PutLogGroupDeletionProtection_Examples"></a>

### Sample Request
<a name="API_PutLogGroupDeletionProtection_Example_1"></a>

This example illustrates one usage of PutLogGroupDeletionProtection.

#### Sample Request
<a name="API_PutLogGroupDeletionProtection_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.PutLogGroupDeletionProtection
{
  "logGroupIdentifier": "my-log-group",
  "deletionProtectionEnabled": true
}
```

#### Sample Response
<a name="API_PutLogGroupDeletionProtection_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: 0
Date: <Date>
```

## See Also
<a name="API_PutLogGroupDeletionProtection_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/PutLogGroupDeletionProtection) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/PutLogGroupDeletionProtection) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/PutLogGroupDeletionProtection) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/PutLogGroupDeletionProtection) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/PutLogGroupDeletionProtection) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/PutLogGroupDeletionProtection) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/PutLogGroupDeletionProtection) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/PutLogGroupDeletionProtection) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/PutLogGroupDeletionProtection) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/PutLogGroupDeletionProtection) 

# PutMetricFilter
<a name="API_PutMetricFilter"></a>

Creates or updates a metric filter and associates it with the specified log group. With metric filters, you can configure rules to extract metric data from log events ingested through [PutLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html).

The maximum number of metric filters that can be associated with a log group is 100.

Using regular expressions in filter patterns is supported. For these filters, there is a quota of two regular expression patterns within a single filter pattern. There is also a quota of five regular expression patterns per log group. For more information about using regular expressions in filter patterns, see [ Filter pattern syntax for metric filters, subscription filters, filter log events, and Live Tail](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html).

When you create a metric filter, you can also optionally assign a unit and dimensions to the metric that is created.

**Important**  
Metrics extracted from log events are charged as custom metrics. To prevent unexpected high charges, do not specify high-cardinality fields such as `IPAddress` or `requestID` as dimensions. Each different value found for a dimension is treated as a separate metric and accrues charges as a separate custom metric.   
CloudWatch Logs might disable a metric filter if it generates 1,000 different name/value pairs for your specified dimensions within one hour.  
You can also set up a billing alarm to alert you if your charges are higher than expected. For more information, see [ Creating a Billing Alarm to Monitor Your Estimated AWS Charges](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/monitor_estimated_charges_with_cloudwatch.html). 

## Request Syntax
<a name="API_PutMetricFilter_RequestSyntax"></a>

```
{
   "applyOnTransformedLogs": boolean,
   "emitSystemFieldDimensions": [ "string" ],
   "fieldSelectionCriteria": "string",
   "filterName": "string",
   "filterPattern": "string",
   "logGroupName": "string",
   "metricTransformations": [ 
      { 
         "defaultValue": number,
         "dimensions": { 
            "string" : "string" 
         },
         "metricName": "string",
         "metricNamespace": "string",
         "metricValue": "string",
         "unit": "string"
      }
   ]
}
```

## Request Parameters
<a name="API_PutMetricFilter_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [applyOnTransformedLogs](#API_PutMetricFilter_RequestSyntax) **   <a name="CWL-PutMetricFilter-request-applyOnTransformedLogs"></a>
This parameter is valid only for log groups that have an active log transformer. For more information about log transformers, see [PutTransformer](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutTransformer.html).  
If the log group uses either a log-group level or account-level transformer, and you specify `true`, the metric filter will be applied on the transformed version of the log events instead of the original ingested log events.  
Type: Boolean  
Required: No

 ** [emitSystemFieldDimensions](#API_PutMetricFilter_RequestSyntax) **   <a name="CWL-PutMetricFilter-request-emitSystemFieldDimensions"></a>
A list of system fields to emit as additional dimensions in the generated metrics. Valid values are `@aws.account` and `@aws.region`. These dimensions help identify the source of centralized log data and count toward the total dimension limit for metric filters.  
Type: Array of strings  
Required: No

 ** [fieldSelectionCriteria](#API_PutMetricFilter_RequestSyntax) **   <a name="CWL-PutMetricFilter-request-fieldSelectionCriteria"></a>
A filter expression that specifies which log events should be processed by this metric filter based on system fields such as source account and source region. Uses selection criteria syntax with operators like `=`, `!=`, `AND`, `OR`, `IN`, `NOT IN`. Example: `@aws.region = "us-east-1"` or `@aws.account IN ["123456789012", "987654321098"]`. Maximum length: 2000 characters.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 2000.  
Required: No

 ** [filterName](#API_PutMetricFilter_RequestSyntax) **   <a name="CWL-PutMetricFilter-request-filterName"></a>
A name for the metric filter.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[^:*]*`   
Required: Yes

 ** [filterPattern](#API_PutMetricFilter_RequestSyntax) **   <a name="CWL-PutMetricFilter-request-filterPattern"></a>
A filter pattern for extracting metric data out of ingested log events.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Required: Yes

 ** [logGroupName](#API_PutMetricFilter_RequestSyntax) **   <a name="CWL-PutMetricFilter-request-logGroupName"></a>
The name of the log group.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[\.\-_/#A-Za-z0-9]+`   
Required: Yes

 ** [metricTransformations](#API_PutMetricFilter_RequestSyntax) **   <a name="CWL-PutMetricFilter-request-metricTransformations"></a>
A collection of information that defines how metric data gets emitted.  
Type: Array of [MetricTransformation](API_MetricTransformation.md) objects  
Array Members: Fixed number of 1 item.  
Required: Yes

## Response Elements
<a name="API_PutMetricFilter_ResponseElements"></a>

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

## Errors
<a name="API_PutMetricFilter_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidOperationException **   
The operation is not valid on the specified resource.  
HTTP Status Code: 400

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** LimitExceededException **   
You have reached the maximum number of resources that can be created.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
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
<a name="API_PutMetricFilter_Examples"></a>

### To create or update a metric filter
<a name="API_PutMetricFilter_Example_1"></a>

The following example creates a metric filter for the specified log group.

#### Sample Request
<a name="API_PutMetricFilter_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.PutMetricFilter
{
  "logGroupName": "my-log-group",
  "filterName": "my-metric-filter",
  "filterPattern": "[ip, identity, user_id, timestamp, request, status_code, size]",
  "metricTransformations": [
    {
      "defaultValue": "0",
      "metricValue": "$size",
      "metricNamespace": "MyApp",
      "metricName": "Volume",
      "dimensions": {"Request": "$request","UserId": "$user_id"},
      "unit": "Count"
    }
  ]
}
```

#### Sample Response
<a name="API_PutMetricFilter_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
```

## See Also
<a name="API_PutMetricFilter_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/PutMetricFilter) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/PutMetricFilter) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/PutMetricFilter) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/PutMetricFilter) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/PutMetricFilter) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/PutMetricFilter) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/PutMetricFilter) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/PutMetricFilter) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/PutMetricFilter) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/PutMetricFilter) 

# PutQueryDefinition
<a name="API_PutQueryDefinition"></a>

Creates or updates a query definition for CloudWatch Logs Insights. For more information, see [Analyzing Log Data with CloudWatch Logs Insights](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AnalyzingLogData.html).

To update a query definition, specify its `queryDefinitionId` in your request. The values of `name`, `queryString`, and `logGroupNames` are changed to the values that you specify in your update operation. No current values are retained from the current query definition. For example, imagine updating a current query definition that includes log groups. If you don't specify the `logGroupNames` parameter in your update operation, the query definition changes to contain no log groups.

You must have the `logs:PutQueryDefinition` permission to be able to perform this operation.

## Request Syntax
<a name="API_PutQueryDefinition_RequestSyntax"></a>

```
{
   "clientToken": "string",
   "logGroupNames": [ "string" ],
   "name": "string",
   "parameters": [ 
      { 
         "defaultValue": "string",
         "description": "string",
         "name": "string"
      }
   ],
   "queryDefinitionId": "string",
   "queryLanguage": "string",
   "queryString": "string"
}
```

## Request Parameters
<a name="API_PutQueryDefinition_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [clientToken](#API_PutQueryDefinition_RequestSyntax) **   <a name="CWL-PutQueryDefinition-request-clientToken"></a>
Used as an idempotency token, to avoid returning an exception if the service receives the same request twice because of a network error.  
Type: String  
Length Constraints: Minimum length of 36. Maximum length of 128.  
Pattern: `\S{36,128}`   
Required: No

 ** [logGroupNames](#API_PutQueryDefinition_RequestSyntax) **   <a name="CWL-PutQueryDefinition-request-logGroupNames"></a>
Use this parameter to include specific log groups as part of your query definition. If your query uses the OpenSearch Service query language, you specify the log group names inside the `querystring` instead of here.  
If you are updating an existing query definition for the Logs Insights QL or OpenSearch Service PPL and you omit this parameter, then the updated definition will contain no log groups.  
Type: Array of strings  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[\.\-_/#A-Za-z0-9]+`   
Required: No

 ** [name](#API_PutQueryDefinition_RequestSyntax) **   <a name="CWL-PutQueryDefinition-request-name"></a>
A name for the query definition. If you are saving numerous query definitions, we recommend that you name them. This way, you can find the ones you want by using the first part of the name as a filter in the `queryDefinitionNamePrefix` parameter of [DescribeQueryDefinitions](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeQueryDefinitions.html).  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 255.  
Required: Yes

 ** [parameters](#API_PutQueryDefinition_RequestSyntax) **   <a name="CWL-PutQueryDefinition-request-parameters"></a>
Use this parameter to include specific query parameters as part of your query definition. Query parameters are supported only for Logs Insights QL queries. Query parameters allow you to use placeholder variables in your query string that are substituted with values at execution time. Use the `{{parameterName}}` syntax in your query string to reference a parameter.  
Type: Array of [QueryParameter](API_QueryParameter.md) objects  
Array Members: Maximum number of 20 items.  
Required: No

 ** [queryDefinitionId](#API_PutQueryDefinition_RequestSyntax) **   <a name="CWL-PutQueryDefinition-request-queryDefinitionId"></a>
If you are updating a query definition, use this parameter to specify the ID of the query definition that you want to update. You can use [DescribeQueryDefinitions](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeQueryDefinitions.html) to retrieve the IDs of your saved query definitions.  
If you are creating a query definition, do not specify this parameter. CloudWatch generates a unique ID for the new query definition and include it in the response to this operation.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 256.  
Required: No

 ** [queryLanguage](#API_PutQueryDefinition_RequestSyntax) **   <a name="CWL-PutQueryDefinition-request-queryLanguage"></a>
Specify the query language to use for this query. The options are Logs Insights QL, OpenSearch PPL, and OpenSearch SQL. For more information about the query languages that CloudWatch Logs supports, see [Supported query languages](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_AnalyzeLogData_Languages.html).  
Type: String  
Valid Values: `CWLI | SQL | PPL`   
Required: No

 ** [queryString](#API_PutQueryDefinition_RequestSyntax) **   <a name="CWL-PutQueryDefinition-request-queryString"></a>
The query string to use for this definition. For more information, see [CloudWatch Logs Insights Query Syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html).  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 10000.  
Required: Yes

## Response Syntax
<a name="API_PutQueryDefinition_ResponseSyntax"></a>

```
{
   "queryDefinitionId": "string"
}
```

## Response Elements
<a name="API_PutQueryDefinition_ResponseElements"></a>

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

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

 ** [queryDefinitionId](#API_PutQueryDefinition_ResponseSyntax) **   <a name="CWL-PutQueryDefinition-response-queryDefinitionId"></a>
The ID of the query definition.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 256.

## Errors
<a name="API_PutQueryDefinition_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** LimitExceededException **   
You have reached the maximum number of resources that can be created.  
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
<a name="API_PutQueryDefinition_Examples"></a>

### Create a new query definition
<a name="API_PutQueryDefinition_Example_1"></a>

This example creates a query definition. 

#### Sample Request
<a name="API_PutQueryDefinition_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.PutQueryDefinition
{
   "querystring": "stats sum(packets) as packetsTransferred by srcAddr, dstAddr | sort packetsTransferred  desc | limit 15",
   "name": "VPC-top15-packet-transfers",
   "logGroupNames": [ "VPC_Flow_Log1", "VPC_Flow_Log2" ],
}
```

#### Sample Response
<a name="API_PutQueryDefinition_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
   "queryDefinitionId": "123456ab-12ab-123a-789e-1234567890ab"
}
```

### Update a query definition
<a name="API_PutQueryDefinition_Example_2"></a>

This example updates the query definition that was created in the previous example. The query is changed to show the top 25 responses instead of the top 15, and the name of the query is changed to reflect this.

#### Sample Request
<a name="API_PutQueryDefinition_Example_2_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.PutQueryDefinition
{
   "queryDefinitionId": "123456ab-12ab-123a-789e-1234567890ab",
   "querystring": "stats sum(packets) as packetsTransferred by srcAddr, dstAddr | sort packetsTransferred  desc | limit 25",
   "name": "VPC-top25-packet-transfers",
}
```

#### Sample Response
<a name="API_PutQueryDefinition_Example_2_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
   "success": True
}
```

### Create a query definition with parameters
<a name="API_PutQueryDefinition_Example_3"></a>

This example creates a parameterized query definition. The query string includes parameter placeholders that are substituted at execution time.

#### Sample Request
<a name="API_PutQueryDefinition_Example_3_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.PutQueryDefinition
{
   "name": "ErrorsByLevel",
   "queryString": "fields @timestamp, @message | filter level = {{logLevel}}",
   "logGroupNames": [ "/aws/lambda/my-function" ],
   "parameters": [
      {
         "name": "logLevel",
         "defaultValue": "ERROR",
         "description": "Log level to filter (ERROR, WARN, INFO, DEBUG)"
      }
   ]
}
```

#### Sample Response
<a name="API_PutQueryDefinition_Example_3_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
   "queryDefinitionId": "12345678-1234-1234-1234-123456789012"
}
```

## See Also
<a name="API_PutQueryDefinition_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/PutQueryDefinition) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/PutQueryDefinition) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/PutQueryDefinition) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/PutQueryDefinition) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/PutQueryDefinition) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/PutQueryDefinition) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/PutQueryDefinition) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/PutQueryDefinition) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/PutQueryDefinition) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/PutQueryDefinition) 

# PutResourcePolicy
<a name="API_PutResourcePolicy"></a>

Creates or updates a resource policy allowing other AWS services to put log events to this account, such as Amazon Route 53. This API has the following restrictions:
+  **Supported actions** - Policy only supports `logs:PutLogEvents` and `logs:CreateLogStream ` actions
+  **Supported principals** - Policy only applies when operations are invoked by AWS service principals (not IAM users, roles, or cross-account principals
+  **Policy limits** - An account can have a maximum of 10 policies without resourceARN and one per LogGroup resourceARN

**Important**  
Resource policies with actions invoked by non-AWS service principals (such as IAM users, roles, or other AWS accounts) will not be enforced. For access control involving these principals, use the IAM policies.

## Request Syntax
<a name="API_PutResourcePolicy_RequestSyntax"></a>

```
{
   "expectedRevisionId": "string",
   "policyDocument": "string",
   "policyName": "string",
   "resourceArn": "string"
}
```

## Request Parameters
<a name="API_PutResourcePolicy_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [expectedRevisionId](#API_PutResourcePolicy_RequestSyntax) **   <a name="CWL-PutResourcePolicy-request-expectedRevisionId"></a>
The expected revision ID of the resource policy. Required when `resourceArn` is provided to prevent concurrent modifications. Use `null` when creating a resource policy for the first time.  
Type: String  
Length Constraints: Minimum length of 1.  
Required: No

 ** [policyDocument](#API_PutResourcePolicy_RequestSyntax) **   <a name="CWL-PutResourcePolicy-request-policyDocument"></a>
Details of the new policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string. This parameter is required.  
The following example creates a resource policy enabling the Route 53 service to put DNS query logs in to the specified log group. Replace `"logArn"` with the ARN of your CloudWatch Logs resource, such as a log group or log stream.  
CloudWatch Logs also supports [aws:SourceArn](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-sourcearn) and [aws:SourceAccount](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-sourceaccount) condition context keys.  
In the example resource policy, you would replace the value of `SourceArn` with the resource making the call from Route 53 to CloudWatch Logs. You would also replace the value of `SourceAccount` with the AWS account ID making that call.  
  
 `{ "Version": "2012-10-17", "Statement": [ { "Sid": "Route53LogsToCloudWatchLogs", "Effect": "Allow", "Principal": { "Service": [ "route53.amazonaws.com" ] }, "Action": "logs:PutLogEvents", "Resource": "logArn", "Condition": { "ArnLike": { "aws:SourceArn": "myRoute53ResourceArn" }, "StringEquals": { "aws:SourceAccount": "myAwsAccountId" } } } ] }`   
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 51200.  
Required: No

 ** [policyName](#API_PutResourcePolicy_RequestSyntax) **   <a name="CWL-PutResourcePolicy-request-policyName"></a>
Name of the new policy. This parameter is required.  
Type: String  
Required: No

 ** [resourceArn](#API_PutResourcePolicy_RequestSyntax) **   <a name="CWL-PutResourcePolicy-request-resourceArn"></a>
The ARN of the CloudWatch Logs resource to which the resource policy needs to be added or attached. Currently only supports LogGroup ARN.  
Type: String  
Required: No

## Response Syntax
<a name="API_PutResourcePolicy_ResponseSyntax"></a>

```
{
   "resourcePolicy": { 
      "lastUpdatedTime": number,
      "policyDocument": "string",
      "policyName": "string",
      "policyScope": "string",
      "resourceArn": "string",
      "revisionId": "string"
   },
   "revisionId": "string"
}
```

## Response Elements
<a name="API_PutResourcePolicy_ResponseElements"></a>

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

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

 ** [resourcePolicy](#API_PutResourcePolicy_ResponseSyntax) **   <a name="CWL-PutResourcePolicy-response-resourcePolicy"></a>
The new policy.  
Type: [ResourcePolicy](API_ResourcePolicy.md) object

 ** [revisionId](#API_PutResourcePolicy_ResponseSyntax) **   <a name="CWL-PutResourcePolicy-response-revisionId"></a>
The revision ID of the created or updated resource policy. Only returned for resource-scoped policies.  
Type: String  
Length Constraints: Minimum length of 1.

## Errors
<a name="API_PutResourcePolicy_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** LimitExceededException **   
You have reached the maximum number of resources that can be created.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
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

## See Also
<a name="API_PutResourcePolicy_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/PutResourcePolicy) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/PutResourcePolicy) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/PutResourcePolicy) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/PutResourcePolicy) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/PutResourcePolicy) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/PutResourcePolicy) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/PutResourcePolicy) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/PutResourcePolicy) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/PutResourcePolicy) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/PutResourcePolicy) 

# PutRetentionPolicy
<a name="API_PutRetentionPolicy"></a>

Sets the retention of the specified log group. With a retention policy, you can configure the number of days for which to retain log events in the specified log group.

**Note**  
CloudWatch Logs doesn't immediately delete log events when they reach their retention setting. It typically takes up to 72 hours after that before log events are deleted, but in rare situations might take longer.  
To illustrate, imagine that you change a log group to have a longer retention setting when it contains log events that are past the expiration date, but haven't been deleted. Those log events will take up to 72 hours to be deleted after the new retention date is reached. To make sure that log data is deleted permanently, keep a log group at its lower retention setting until 72 hours after the previous retention period ends. Alternatively, wait to change the retention setting until you confirm that the earlier log events are deleted.   
When log events reach their retention setting they are marked for deletion. After they are marked for deletion, they do not add to your archival storage costs anymore, even if they are not actually deleted until later. These log events marked for deletion are also not included when you use an API to retrieve the `storedBytes` value to see how many bytes a log group is storing.

## Request Syntax
<a name="API_PutRetentionPolicy_RequestSyntax"></a>

```
{
   "logGroupName": "string",
   "retentionInDays": number
}
```

## Request Parameters
<a name="API_PutRetentionPolicy_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [logGroupName](#API_PutRetentionPolicy_RequestSyntax) **   <a name="CWL-PutRetentionPolicy-request-logGroupName"></a>
The name of the log group.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[\.\-_/#A-Za-z0-9]+`   
Required: Yes

 ** [retentionInDays](#API_PutRetentionPolicy_RequestSyntax) **   <a name="CWL-PutRetentionPolicy-request-retentionInDays"></a>
The number of days to retain the log events in the specified log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1096, 1827, 2192, 2557, 2922, 3288, and 3653.  
To set a log group so that its log events do not expire, use [DeleteRetentionPolicy](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DeleteRetentionPolicy.html).   
Type: Integer  
Required: Yes

## Response Elements
<a name="API_PutRetentionPolicy_ResponseElements"></a>

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

## Errors
<a name="API_PutRetentionPolicy_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
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
<a name="API_PutRetentionPolicy_Examples"></a>

### To create or update a retention policy for a log group
<a name="API_PutRetentionPolicy_Example_1"></a>

The following example creates a 30-day retention policy for the specified log group.

#### Sample Request
<a name="API_PutRetentionPolicy_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.PutRetentionPolicy
{
  "logGroupName": "my-log-group",
  "retentionInDays": 30
}
```

#### Sample Response
<a name="API_PutRetentionPolicy_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
```

## See Also
<a name="API_PutRetentionPolicy_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/PutRetentionPolicy) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/PutRetentionPolicy) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/PutRetentionPolicy) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/PutRetentionPolicy) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/PutRetentionPolicy) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/PutRetentionPolicy) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/PutRetentionPolicy) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/PutRetentionPolicy) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/PutRetentionPolicy) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/PutRetentionPolicy) 

# PutSubscriptionFilter
<a name="API_PutSubscriptionFilter"></a>

Creates or updates a subscription filter and associates it with the specified log group. With subscription filters, you can subscribe to a real-time stream of log events ingested through [PutLogEvents](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html) and have them delivered to a specific destination. When log events are sent to the receiving service, they are Base64 encoded and compressed with the GZIP format.

The following destinations are supported for subscription filters:
+ An Amazon Kinesis data stream belonging to the same account as the subscription filter, for same-account delivery.
+ A logical destination created with [PutDestination](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDestination.html) that belongs to a different account, for cross-account delivery. We currently support Kinesis Data Streams and Firehose as logical destinations.
+ An Amazon Kinesis Data Firehose delivery stream that belongs to the same account as the subscription filter, for same-account delivery.
+ An AWS Lambda function that belongs to the same account as the subscription filter, for same-account delivery.

Each log group can have up to two subscription filters associated with it. If you are updating an existing filter, you must specify the correct name in `filterName`. 

Using regular expressions in filter patterns is supported. For these filters, there is a quotas of quota of two regular expression patterns within a single filter pattern. There is also a quota of five regular expression patterns per log group. For more information about using regular expressions in filter patterns, see [ Filter pattern syntax for metric filters, subscription filters, filter log events, and Live Tail](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html).

To perform a `PutSubscriptionFilter` operation for any destination except a Lambda function, you must also have the `iam:PassRole` permission.

## Request Syntax
<a name="API_PutSubscriptionFilter_RequestSyntax"></a>

```
{
   "applyOnTransformedLogs": boolean,
   "destinationArn": "string",
   "distribution": "string",
   "emitSystemFields": [ "string" ],
   "fieldSelectionCriteria": "string",
   "filterName": "string",
   "filterPattern": "string",
   "logGroupName": "string",
   "roleArn": "string"
}
```

## Request Parameters
<a name="API_PutSubscriptionFilter_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [applyOnTransformedLogs](#API_PutSubscriptionFilter_RequestSyntax) **   <a name="CWL-PutSubscriptionFilter-request-applyOnTransformedLogs"></a>
This parameter is valid only for log groups that have an active log transformer. For more information about log transformers, see [PutTransformer](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutTransformer.html).  
If the log group uses either a log-group level or account-level transformer, and you specify `true`, the subscription filter will be applied on the transformed version of the log events instead of the original ingested log events.  
Type: Boolean  
Required: No

 ** [destinationArn](#API_PutSubscriptionFilter_RequestSyntax) **   <a name="CWL-PutSubscriptionFilter-request-destinationArn"></a>
The ARN of the destination to deliver matching log events to. Currently, the supported destinations are:  
+ An Amazon Kinesis stream belonging to the same account as the subscription filter, for same-account delivery.
+ A logical destination (specified using an ARN) belonging to a different account, for cross-account delivery.

  If you're setting up a cross-account subscription, the destination must have an IAM policy associated with it. The IAM policy must allow the sender to send logs to the destination. For more information, see [PutDestinationPolicy](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDestinationPolicy.html).
+ A Kinesis Data Firehose delivery stream belonging to the same account as the subscription filter, for same-account delivery.
+ A Lambda function belonging to the same account as the subscription filter, for same-account delivery.
Type: String  
Length Constraints: Minimum length of 1.  
Required: Yes

 ** [distribution](#API_PutSubscriptionFilter_RequestSyntax) **   <a name="CWL-PutSubscriptionFilter-request-distribution"></a>
The method used to distribute log data to the destination. By default, log data is grouped by log stream, but the grouping can be set to random for a more even distribution. This property is only applicable when the destination is an Amazon Kinesis data stream.   
Type: String  
Valid Values: `Random | ByLogStream`   
Required: No

 ** [emitSystemFields](#API_PutSubscriptionFilter_RequestSyntax) **   <a name="CWL-PutSubscriptionFilter-request-emitSystemFields"></a>
A list of system fields to include in the log events sent to the subscription destination. Valid values are `@aws.account` and `@aws.region`. These fields provide source information for centralized log data in the forwarded payload.  
Type: Array of strings  
Required: No

 ** [fieldSelectionCriteria](#API_PutSubscriptionFilter_RequestSyntax) **   <a name="CWL-PutSubscriptionFilter-request-fieldSelectionCriteria"></a>
A filter expression that specifies which log events should be processed by this subscription filter based on system fields such as source account and source region. Uses selection criteria syntax with operators like `=`, `!=`, `AND`, `OR`, `IN`, `NOT IN`. Example: `@aws.region NOT IN ["cn-north-1"]` or `@aws.account = "123456789012" AND @aws.region = "us-east-1"`. Maximum length: 2000 characters.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 2000.  
Required: No

 ** [filterName](#API_PutSubscriptionFilter_RequestSyntax) **   <a name="CWL-PutSubscriptionFilter-request-filterName"></a>
A name for the subscription filter. If you are updating an existing filter, you must specify the correct name in `filterName`. To find the name of the filter currently associated with a log group, use [DescribeSubscriptionFilters](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeSubscriptionFilters.html).  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[^:*]*`   
Required: Yes

 ** [filterPattern](#API_PutSubscriptionFilter_RequestSyntax) **   <a name="CWL-PutSubscriptionFilter-request-filterPattern"></a>
A filter pattern for subscribing to a filtered stream of log events.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Required: Yes

 ** [logGroupName](#API_PutSubscriptionFilter_RequestSyntax) **   <a name="CWL-PutSubscriptionFilter-request-logGroupName"></a>
The name of the log group.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[\.\-_/#A-Za-z0-9]+`   
Required: Yes

 ** [roleArn](#API_PutSubscriptionFilter_RequestSyntax) **   <a name="CWL-PutSubscriptionFilter-request-roleArn"></a>
The ARN of an IAM role that grants CloudWatch Logs permissions to deliver ingested log events to the destination stream. You don't need to provide the ARN when you are working with a logical destination for cross-account delivery.  
Type: String  
Length Constraints: Minimum length of 1.  
Required: No

## Response Elements
<a name="API_PutSubscriptionFilter_ResponseElements"></a>

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

## Errors
<a name="API_PutSubscriptionFilter_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidOperationException **   
The operation is not valid on the specified resource.  
HTTP Status Code: 400

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** LimitExceededException **   
You have reached the maximum number of resources that can be created.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
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
<a name="API_PutSubscriptionFilter_Examples"></a>

### To create or update a subscription filter
<a name="API_PutSubscriptionFilter_Example_1"></a>

The following example creates a subscription filter.

#### Sample Request
<a name="API_PutSubscriptionFilter_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.PutSubscriptionFilter
{
  "logGroupName": "my-log-group",
  "filterName": "my-subscription-filter",
  "filterPattern": "[ip, identity, user_id, timestamp, request, status_code = 500, size]",
  "destinationArn": "arn:aws:kinesis:us-east-1:123456789012:stream/my-kinesis-stream",
  "roleArn": "arn:aws:iam::123456789012:role/my-subscription-role",
  "applyOnTransformedLogs" : true
}
```

#### Sample Response
<a name="API_PutSubscriptionFilter_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
```

## See Also
<a name="API_PutSubscriptionFilter_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/PutSubscriptionFilter) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/PutSubscriptionFilter) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/PutSubscriptionFilter) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/PutSubscriptionFilter) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/PutSubscriptionFilter) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/PutSubscriptionFilter) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/PutSubscriptionFilter) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/PutSubscriptionFilter) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/PutSubscriptionFilter) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/PutSubscriptionFilter) 

# PutTransformer
<a name="API_PutTransformer"></a>

Creates or updates a *log transformer* for a single log group. You use log transformers to transform log events into a different format, making them easier for you to process and analyze. You can also transform logs from different sources into standardized formats that contains relevant, source-specific information.

After you have created a transformer, CloudWatch Logs performs the transformations at the time of log ingestion. You can then refer to the transformed versions of the logs during operations such as querying with CloudWatch Logs Insights or creating metric filters or subscription filers.

You can also use a transformer to copy metadata from metadata keys into the log events themselves. This metadata can include log group name, log stream name, account ID and Region.

A transformer for a log group is a series of processors, where each processor applies one type of transformation to the log events ingested into this log group. The processors work one after another, in the order that you list them, like a pipeline. For more information about the available processors to use in a transformer, see [ Processors that you can use](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-Processors).

Having log events in standardized format enables visibility across your applications for your log analysis, reporting, and alarming needs. CloudWatch Logs provides transformation for common log types with out-of-the-box transformation templates for major AWS log sources such as VPC flow logs, Lambda, and Amazon RDS. You can use pre-built transformation templates or create custom transformation policies.

You can create transformers only for the log groups in the Standard log class.

You can also set up a transformer at the account level. For more information, see [PutAccountPolicy](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutAccountPolicy.html). If there is both a log-group level transformer created with `PutTransformer` and an account-level transformer that could apply to the same log group, the log group uses only the log-group level transformer. It ignores the account-level transformer.

## Request Syntax
<a name="API_PutTransformer_RequestSyntax"></a>

```
{
   "logGroupIdentifier": "string",
   "transformerConfig": [ 
      { 
         "addKeys": { 
            "entries": [ 
               { 
                  "key": "string",
                  "overwriteIfExists": boolean,
                  "value": "string"
               }
            ]
         },
         "copyValue": { 
            "entries": [ 
               { 
                  "overwriteIfExists": boolean,
                  "source": "string",
                  "target": "string"
               }
            ]
         },
         "csv": { 
            "columns": [ "string" ],
            "delimiter": "string",
            "destination": "string",
            "quoteCharacter": "string",
            "source": "string"
         },
         "dateTimeConverter": { 
            "locale": "string",
            "matchPatterns": [ "string" ],
            "source": "string",
            "sourceTimezone": "string",
            "target": "string",
            "targetFormat": "string",
            "targetTimezone": "string"
         },
         "deleteKeys": { 
            "withKeys": [ "string" ]
         },
         "grok": { 
            "match": "string",
            "source": "string"
         },
         "listToMap": { 
            "flatten": boolean,
            "flattenedElement": "string",
            "key": "string",
            "source": "string",
            "target": "string",
            "valueKey": "string"
         },
         "lowerCaseString": { 
            "withKeys": [ "string" ]
         },
         "moveKeys": { 
            "entries": [ 
               { 
                  "overwriteIfExists": boolean,
                  "source": "string",
                  "target": "string"
               }
            ]
         },
         "parseCloudfront": { 
            "source": "string"
         },
         "parseJSON": { 
            "destination": "string",
            "source": "string"
         },
         "parseKeyValue": { 
            "destination": "string",
            "fieldDelimiter": "string",
            "keyPrefix": "string",
            "keyValueDelimiter": "string",
            "nonMatchValue": "string",
            "overwriteIfExists": boolean,
            "source": "string"
         },
         "parsePostgres": { 
            "source": "string"
         },
         "parseRoute53": { 
            "source": "string"
         },
         "parseToOCSF": { 
            "eventSource": "string",
            "mappingVersion": "string",
            "ocsfVersion": "string",
            "source": "string"
         },
         "parseVPC": { 
            "source": "string"
         },
         "parseWAF": { 
            "source": "string"
         },
         "renameKeys": { 
            "entries": [ 
               { 
                  "key": "string",
                  "overwriteIfExists": boolean,
                  "renameTo": "string"
               }
            ]
         },
         "splitString": { 
            "entries": [ 
               { 
                  "delimiter": "string",
                  "source": "string"
               }
            ]
         },
         "substituteString": { 
            "entries": [ 
               { 
                  "from": "string",
                  "source": "string",
                  "to": "string"
               }
            ]
         },
         "trimString": { 
            "withKeys": [ "string" ]
         },
         "typeConverter": { 
            "entries": [ 
               { 
                  "key": "string",
                  "type": "string"
               }
            ]
         },
         "upperCaseString": { 
            "withKeys": [ "string" ]
         }
      }
   ]
}
```

## Request Parameters
<a name="API_PutTransformer_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [logGroupIdentifier](#API_PutTransformer_RequestSyntax) **   <a name="CWL-PutTransformer-request-logGroupIdentifier"></a>
Specify either the name or ARN of the log group to create the transformer for.   
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Pattern: `[\w#+=/:,.@-]*`   
Required: Yes

 ** [transformerConfig](#API_PutTransformer_RequestSyntax) **   <a name="CWL-PutTransformer-request-transformerConfig"></a>
This structure contains the configuration of this log transformer. A log transformer is an array of processors, where each processor applies one type of transformation to the log events that are ingested.  
Type: Array of [Processor](API_Processor.md) objects  
Array Members: Minimum number of 1 item. Maximum number of 20 items.  
Required: Yes

## Response Elements
<a name="API_PutTransformer_ResponseElements"></a>

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

## Errors
<a name="API_PutTransformer_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidOperationException **   
The operation is not valid on the specified resource.  
HTTP Status Code: 400

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** LimitExceededException **   
You have reached the maximum number of resources that can be created.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
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
<a name="API_PutTransformer_Examples"></a>

### To create a log transformer
<a name="API_PutTransformer_Example_1"></a>

The following example creates a log transformer for the specified log group.

#### Sample Request
<a name="API_PutTransformer_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.PutTransformer
{
    "logGroupIdentifier": "my-log-group-name",
    "transformerConfig": [
        {
            "parseJSON": {}
        },
        {
            "addKeys": {
                "entries": [
                    {
                        "key": "metadata.transformed_in",
                        "value": "CloudWatchLogs"
                    }
                ]
            }
        },
        {
            "trimString": {
                "withKeys": [
                    "status"
                ]
            }
        },
        {
            "lowerCaseString": {
                "withKeys": [
                    "status"
                ]
            }
        }
    ]
}
```

## See Also
<a name="API_PutTransformer_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/PutTransformer) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/PutTransformer) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/PutTransformer) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/PutTransformer) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/PutTransformer) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/PutTransformer) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/PutTransformer) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/PutTransformer) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/PutTransformer) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/PutTransformer) 

# StartLiveTail
<a name="API_StartLiveTail"></a>

Starts a Live Tail streaming session for one or more log groups. A Live Tail session returns a stream of log events that have been recently ingested in the log groups. For more information, see [Use Live Tail to view logs in near real time](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatchLogs_LiveTail.html). 

The response to this operation is a response stream, over which the server sends live log events and the client receives them.

The following objects are sent over the stream:
+ A single [LiveTailSessionStart](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_LiveTailSessionStart.html) object is sent at the start of the session.
+ Every second, a [LiveTailSessionUpdate](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_LiveTailSessionUpdate.html) object is sent. Each of these objects contains an array of the actual log events.

  If no new log events were ingested in the past second, the `LiveTailSessionUpdate` object will contain an empty array.

  The array of log events contained in a `LiveTailSessionUpdate` can include as many as 500 log events. If the number of log events matching the request exceeds 500 per second, the log events are sampled down to 500 log events to be included in each `LiveTailSessionUpdate` object.

  If your client consumes the log events slower than the server produces them, CloudWatch Logs buffers up to 10 `LiveTailSessionUpdate` events or 5000 log events, after which it starts dropping the oldest events.
+ A [SessionStreamingException](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_StartLiveTailResponseStream.html#CWL-Type-StartLiveTailResponseStream-SessionStreamingException) object is returned if an unknown error occurs on the server side.
+ A [SessionTimeoutException](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_StartLiveTailResponseStream.html#CWL-Type-StartLiveTailResponseStream-SessionTimeoutException) object is returned when the session times out, after it has been kept open for three hours.

**Note**  
The `StartLiveTail` API routes requests using SDK host prefix injection. SDK versions released before April 1, 2026 route to `streaming-logs.Region.amazonaws.com`, which does not support VPC endpoints. SDK versions released on or after April 1, 2026 route to `stream-logs.Region.amazonaws.com`, which supports VPC endpoints. To set up a VPC endpoint for this API, see [Creating a VPC endpoint for CloudWatch Logs ](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/cloudwatch-logs-and-interface-VPC.html#create-VPC-endpoint-for-CloudWatchLogs).

**Important**  
You can end a session before it times out by closing the session stream or by closing the client that is receiving the stream. The session also ends if the established connection between the client and the server breaks.

For examples of using an SDK to start a Live Tail session, see [ Start a Live Tail session using an AWS SDK](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/example_cloudwatch-logs_StartLiveTail_section.html).

## Request Syntax
<a name="API_StartLiveTail_RequestSyntax"></a>

```
{
   "logEventFilterPattern": "string",
   "logGroupIdentifiers": [ "string" ],
   "logStreamNamePrefixes": [ "string" ],
   "logStreamNames": [ "string" ]
}
```

## Request Parameters
<a name="API_StartLiveTail_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [logEventFilterPattern](#API_StartLiveTail_RequestSyntax) **   <a name="CWL-StartLiveTail-request-logEventFilterPattern"></a>
An optional pattern to use to filter the results to include only log events that match the pattern. For example, a filter pattern of `error 404` causes only log events that include both `error` and `404` to be included in the Live Tail stream.  
Regular expression filter patterns are supported.  
For more information about filter pattern syntax, see [Filter and Pattern Syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html).  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Required: No

 ** [logGroupIdentifiers](#API_StartLiveTail_RequestSyntax) **   <a name="CWL-StartLiveTail-request-logGroupIdentifiers"></a>
An array where each item in the array is a log group to include in the Live Tail session.  
Specify each log group by its ARN.   
If you specify an ARN, the ARN can't end with an asterisk (\$1).  
 You can include up to 10 log groups.
Type: Array of strings  
Array Members: Minimum number of 1 item. Maximum number of 10 items.  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Pattern: `[\w#+=/:,.@-]*`   
Required: Yes

 ** [logStreamNamePrefixes](#API_StartLiveTail_RequestSyntax) **   <a name="CWL-StartLiveTail-request-logStreamNamePrefixes"></a>
If you specify this parameter, then only log events in the log streams that have names that start with the prefixes that you specify here are included in the Live Tail session.  
If you specify this field, you can't also specify the `logStreamNames` field.  
You can specify this parameter only if you specify only one log group in `logGroupIdentifiers`.
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.  
Pattern: `[^:*]*`   
Required: No

 ** [logStreamNames](#API_StartLiveTail_RequestSyntax) **   <a name="CWL-StartLiveTail-request-logStreamNames"></a>
If you specify this parameter, then only log events in the log streams that you specify here are included in the Live Tail session.  
If you specify this field, you can't also specify the `logStreamNamePrefixes` field.  
You can specify this parameter only if you specify only one log group in `logGroupIdentifiers`.
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.  
Pattern: `[^:*]*`   
Required: No

## Response Syntax
<a name="API_StartLiveTail_ResponseSyntax"></a>

```
{
   "responseStream": { 
      "sessionStart": { 
         "logEventFilterPattern": "string",
         "logGroupIdentifiers": [ "string" ],
         "logStreamNamePrefixes": [ "string" ],
         "logStreamNames": [ "string" ],
         "requestId": "string",
         "sessionId": "string"
      },
      "SessionStreamingException": { 
      },
      "SessionTimeoutException": { 
      },
      "sessionUpdate": { 
         "sessionMetadata": { 
            "sampled": boolean
         },
         "sessionResults": [ 
            { 
               "ingestionTime": number,
               "logGroupIdentifier": "string",
               "logStreamName": "string",
               "message": "string",
               "timestamp": number
            }
         ]
      }
   }
}
```

## Response Elements
<a name="API_StartLiveTail_ResponseElements"></a>

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

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

 ** [responseStream](#API_StartLiveTail_ResponseSyntax) **   <a name="CWL-StartLiveTail-response-responseStream"></a>
An object that includes the stream returned by your request. It can include both log events and exceptions.  
Type: [StartLiveTailResponseStream](API_StartLiveTailResponseStream.md) object

## Errors
<a name="API_StartLiveTail_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have sufficient permissions to perform this action.  
HTTP Status Code: 400

 ** InvalidOperationException **   
The operation is not valid on the specified resource.  
HTTP Status Code: 400

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** LimitExceededException **   
You have reached the maximum number of resources that can be created.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
The specified resource does not exist.  
HTTP Status Code: 400

## See Also
<a name="API_StartLiveTail_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/StartLiveTail) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/StartLiveTail) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/StartLiveTail) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/StartLiveTail) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/StartLiveTail) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/StartLiveTail) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/StartLiveTail) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/StartLiveTail) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/StartLiveTail) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/StartLiveTail) 

# StartQuery
<a name="API_StartQuery"></a>

Starts a query of one or more log groups or data sources using CloudWatch Logs Insights. You specify the log groups or data sources and time range to query and the query string to use. You can query up to 10 data sources in a single query.

For more information, see [CloudWatch Logs Insights Query Syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html).

After you run a query using `StartQuery`, the query results are stored by CloudWatch Logs. You can use [GetQueryResults](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_GetQueryResults.html) to retrieve the results of a query, using the `queryId` that `StartQuery` returns. 

Interactive queries started with `StartQuery` share concurrency limits with automated scheduled query executions. Both types of queries count toward the same regional concurrent query quota, so high scheduled query activity may affect the availability of concurrent slots for interactive queries.

**Note**  
To specify the log groups to query, a `StartQuery` operation must include one of the following:  
Either exactly one of the following parameters: `logGroupName`, `logGroupNames`, or `logGroupIdentifiers` 
Or the `queryString` must include a `SOURCE` command to select log groups for the query. The `SOURCE` command can select log groups based on log group name prefix, account ID, and log class, or select data sources using dataSource syntax in LogsQL, PPL, and SQL.   
For more information about the `SOURCE` command, see [SOURCE](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax-Source.html).

If you have associated a AWS KMS key with the query results in this account, then [StartQuery](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_StartQuery.html) uses that key to encrypt the results when it stores them. If no key is associated with query results, the query results are encrypted with the default CloudWatch Logs encryption method.

Queries time out after 60 minutes of runtime. If your queries are timing out, reduce the time range being searched or partition your query into a number of queries.

If you are using CloudWatch cross-account observability, you can use this operation in a monitoring account to start a query in a linked source account. For more information, see [CloudWatch cross-account observability](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html). For a cross-account `StartQuery` operation, the query definition must be defined in the monitoring account.

You can have up to 100 concurrent CloudWatch Logs insights queries, including queries that have been added to dashboards. 

## Request Syntax
<a name="API_StartQuery_RequestSyntax"></a>

```
{
   "endTime": number,
   "limit": number,
   "logGroupIdentifiers": [ "string" ],
   "logGroupName": "string",
   "logGroupNames": [ "string" ],
   "queryLanguage": "string",
   "queryString": "string",
   "startTime": number
}
```

## Request Parameters
<a name="API_StartQuery_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [endTime](#API_StartQuery_RequestSyntax) **   <a name="CWL-StartQuery-request-endTime"></a>
The end of the time range to query. The range is inclusive, so the specified end time is included in the query. Specified as epoch time, the number of seconds since `January 1, 1970, 00:00:00 UTC`.  
Type: Long  
Valid Range: Minimum value of 0.  
Required: Yes

 ** [limit](#API_StartQuery_RequestSyntax) **   <a name="CWL-StartQuery-request-limit"></a>
The maximum number of log events to return in the query. If the query string uses the `fields` command, only the specified fields and their values are returned. The default is 10,000.  
Type: Integer  
Valid Range: Minimum value of 1. Maximum value of 10000.  
Required: No

 ** [logGroupIdentifiers](#API_StartQuery_RequestSyntax) **   <a name="CWL-StartQuery-request-logGroupIdentifiers"></a>
The list of log groups to query. You can include up to 50 log groups.  
You can specify them by the log group name or ARN. If a log group that you're querying is in a source account and you're using a monitoring account, you must specify the ARN of the log group here. The query definition must also be defined in the monitoring account.  
If you specify an ARN, use the format arn:aws:logs:*region*:*account-id*:log-group:*log\$1group\$1name* Don't include an \$1 at the end.  
A `StartQuery` operation must include exactly one of the following parameters: `logGroupName`, `logGroupNames`, or `logGroupIdentifiers`. The exception is queries using the OpenSearch Service SQL query language, where you specify the log group names inside the `querystring` instead of here.   
Type: Array of strings  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Pattern: `[\w#+=/:,.@-]*`   
Required: No

 ** [logGroupName](#API_StartQuery_RequestSyntax) **   <a name="CWL-StartQuery-request-logGroupName"></a>
The log group on which to perform the query.  
A `StartQuery` operation must include exactly one of the following parameters: `logGroupName`, `logGroupNames`, or `logGroupIdentifiers`. The exception is queries using the OpenSearch Service SQL query language, where you specify the log group names inside the `querystring` instead of here.
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[\.\-_/#A-Za-z0-9]+`   
Required: No

 ** [logGroupNames](#API_StartQuery_RequestSyntax) **   <a name="CWL-StartQuery-request-logGroupNames"></a>
The list of log groups to be queried. You can include up to 50 log groups.  
A `StartQuery` operation must include exactly one of the following parameters: `logGroupName`, `logGroupNames`, or `logGroupIdentifiers`. The exception is queries using the OpenSearch Service SQL query language, where you specify the log group names inside the `querystring` instead of here.
Type: Array of strings  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[\.\-_/#A-Za-z0-9]+`   
Required: No

 ** [queryLanguage](#API_StartQuery_RequestSyntax) **   <a name="CWL-StartQuery-request-queryLanguage"></a>
Specify the query language to use for this query. The options are Logs Insights QL, OpenSearch PPL, and OpenSearch SQL. For more information about the query languages that CloudWatch Logs supports, see [Supported query languages](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_AnalyzeLogData_Languages.html).  
Type: String  
Valid Values: `CWLI | SQL | PPL`   
Required: No

 ** [queryString](#API_StartQuery_RequestSyntax) **   <a name="CWL-StartQuery-request-queryString"></a>
The query string to use. For more information, see [CloudWatch Logs Insights Query Syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html).  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 10000.  
Required: Yes

 ** [startTime](#API_StartQuery_RequestSyntax) **   <a name="CWL-StartQuery-request-startTime"></a>
The beginning of the time range to query. The range is inclusive, so the specified start time is included in the query. Specified as epoch time, the number of seconds since `January 1, 1970, 00:00:00 UTC`.  
Type: Long  
Valid Range: Minimum value of 0.  
Required: Yes

## Response Syntax
<a name="API_StartQuery_ResponseSyntax"></a>

```
{
   "queryId": "string"
}
```

## Response Elements
<a name="API_StartQuery_ResponseElements"></a>

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

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

 ** [queryId](#API_StartQuery_ResponseSyntax) **   <a name="CWL-StartQuery-response-queryId"></a>
The unique ID of the query.   
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 256.

## Errors
<a name="API_StartQuery_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** LimitExceededException **   
You have reached the maximum number of resources that can be created.  
HTTP Status Code: 400

 ** MalformedQueryException **   
The query string is not valid. Details about this error are displayed in a `QueryCompileError` object. For more information, see [QueryCompileError](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_QueryCompileError.html).  
For more information about valid query syntax, see [CloudWatch Logs Insights Query Syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html).    
 ** queryCompileError **   
Reserved.
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
<a name="API_StartQuery_Examples"></a>

### Example: Start a query
<a name="API_StartQuery_Example_1"></a>

This example starts a query of three log groups, specifying the query string and start time. It also limits the results to the most recent 100 matching events.

#### Sample Request
<a name="API_StartQuery_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.StartQuery
{
    "limit": 100,
    "logGroupNames": [
        "LogGroupName1",
        "LogGroupName2",
        "LogGroupName3"
    ],
    "queryString": "stats count(*) by eventSource, eventName, awsRegion",
    "startTime": 1546300800,
    "endTime": 1546309800
}
```

#### Sample Response
<a name="API_StartQuery_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
   "queryId": "12ab3456-12ab-123a-789e-1234567890ab"
}
```

### Example: Start a query
<a name="API_StartQuery_Example_2"></a>

 This example starts a query for a log group ARN and specifies a query string. It also specifies the request start and end times. 

#### Sample Request
<a name="API_StartQuery_Example_2_Request"></a>

```
{
    "limit": 100,
    "logGroupIdentifiers": [
        "arn:aws:logs:us-east-1:123456789012:log-group:monitoring-logGroup-1234"
     ],
    "queryString": "stats count(*) by eventSource, eventName, awsRegion",
    "startTime": 1546300800,
    "endTime": 1546309800
}
```

#### Sample Response
<a name="API_StartQuery_Example_2_Response"></a>

```
{
    "queryId": "12ab3456-12ab-123a-789e-1234567890ab"
}
```

### Example: Start a query using field indexing and the source command
<a name="API_StartQuery_Example_3"></a>

This example queries all log groups in the `111122223333` account that have log group names that start with `my-log`. It leverages field indexing so that only log groups and log events known to match the indexed field `transactionId` are processed. Only log events that include the value `tx-001` for the `transactionId` field will be returned.

#### Sample Request
<a name="API_StartQuery_Example_3_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.StartQuery
{
 "queryString":
  "source logGroups(namePrefix: ['my-log'], accountIdentifiers: ['accountId' = '111122223333'])
 | filterIndex transactionId = 'tx-001'",
    "startTime": 1722704400000,
    "endTime": 1722705229849
}
```

## See Also
<a name="API_StartQuery_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/StartQuery) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/StartQuery) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/StartQuery) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/StartQuery) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/StartQuery) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/StartQuery) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/StartQuery) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/StartQuery) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/StartQuery) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/StartQuery) 

# StopQuery
<a name="API_StopQuery"></a>

Stops a CloudWatch Logs Insights query that is in progress. If the query has already ended, the operation returns an error indicating that the specified query is not running.

This operation can be used to cancel both interactive queries and individual scheduled query executions. When used with scheduled queries, `StopQuery` cancels only the specific execution identified by the query ID, not the scheduled query configuration itself.

## Request Syntax
<a name="API_StopQuery_RequestSyntax"></a>

```
{
   "queryId": "string"
}
```

## Request Parameters
<a name="API_StopQuery_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [queryId](#API_StopQuery_RequestSyntax) **   <a name="CWL-StopQuery-request-queryId"></a>
The ID number of the query to stop. To find this ID number, use `DescribeQueries`.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 256.  
Required: Yes

## Response Syntax
<a name="API_StopQuery_ResponseSyntax"></a>

```
{
   "success": boolean
}
```

## Response Elements
<a name="API_StopQuery_ResponseElements"></a>

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

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

 ** [success](#API_StopQuery_ResponseSyntax) **   <a name="CWL-StopQuery-response-success"></a>
This is true if the query was stopped by the `StopQuery` operation.  
Type: Boolean

## Errors
<a name="API_StopQuery_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** 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
<a name="API_StopQuery_Examples"></a>

### Stop a query that is currently running
<a name="API_StopQuery_Example_1"></a>

The following example stops the specified query, if it is currently running.

#### Sample Request
<a name="API_StopQuery_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.StopQuery
{
   "queryId": "12ab3456-12ab-123a-789e-1234567890ab"
}
```

#### Sample Response
<a name="API_StopQuery_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
   "success": True
}
```

## See Also
<a name="API_StopQuery_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/StopQuery) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/StopQuery) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/StopQuery) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/StopQuery) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/StopQuery) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/StopQuery) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/StopQuery) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/StopQuery) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/StopQuery) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/StopQuery) 

# TagLogGroup
<a name="API_TagLogGroup"></a>

**Important**  
The TagLogGroup operation is on the path to deprecation. We recommend that you use [TagResource](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_TagResource.html) instead.

Adds or updates the specified tags for the specified log group.

To list the tags for a log group, use [ListTagsForResource](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_ListTagsForResource.html). To remove tags, use [UntagResource](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_UntagResource.html).

For more information about tags, see [Tag Log Groups in Amazon CloudWatch Logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html#log-group-tagging) in the *Amazon CloudWatch Logs User Guide*.

CloudWatch Logs doesn't support IAM policies that prevent users from assigning specified tags to log groups using the `aws:Resource/key-name ` or `aws:TagKeys` condition keys. For more information about using tags to control access, see [Controlling access to Amazon Web Services resources using tags](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_tags.html).

## Request Syntax
<a name="API_TagLogGroup_RequestSyntax"></a>

```
{
   "logGroupName": "string",
   "tags": { 
      "string" : "string" 
   }
}
```

## Request Parameters
<a name="API_TagLogGroup_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [logGroupName](#API_TagLogGroup_RequestSyntax) **   <a name="CWL-TagLogGroup-request-logGroupName"></a>
The name of the log group.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[\.\-_/#A-Za-z0-9]+`   
Required: Yes

 ** [tags](#API_TagLogGroup_RequestSyntax) **   <a name="CWL-TagLogGroup-request-tags"></a>
The key-value pairs to use for the tags.  
Type: String to string map  
Map Entries: Maximum number of 50 items.  
Key Length Constraints: Minimum length of 1. Maximum length of 128.  
Key Pattern: `^([\p{L}\p{Z}\p{N}_.:/=+\-@]+)$`   
Value Length Constraints: Maximum length of 256.  
Value Pattern: `^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$`   
Required: Yes

## Response Elements
<a name="API_TagLogGroup_ResponseElements"></a>

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

## Errors
<a name="API_TagLogGroup_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
The specified resource does not exist.  
HTTP Status Code: 400

## Examples
<a name="API_TagLogGroup_Examples"></a>

### To add tags for a log group
<a name="API_TagLogGroup_Example_1"></a>

The following example adds the specified tags for the specified log group.

#### Sample Request
<a name="API_TagLogGroup_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.TagLogGroup
{
  "logGroupName": "my-log-group",
  "tags": {
      "Project": "A",
      "Environment": "test"
  }
}
```

#### Sample Response
<a name="API_TagLogGroup_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
```

## See Also
<a name="API_TagLogGroup_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/TagLogGroup) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/TagLogGroup) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/TagLogGroup) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/TagLogGroup) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/TagLogGroup) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/TagLogGroup) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/TagLogGroup) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/TagLogGroup) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/TagLogGroup) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/TagLogGroup) 

# TagResource
<a name="API_TagResource"></a>

Assigns one or more tags (key-value pairs) to the specified CloudWatch Logs resource. Currently, the only CloudWatch Logs resources that can be tagged are log groups and destinations. 

Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.

Tags don't have any semantic meaning to AWS and are interpreted strictly as strings of characters.

You can use the `TagResource` action with a resource that already has tags. If you specify a new tag key for the alarm, this tag is appended to the list of tags associated with the alarm. If you specify a tag key that is already associated with the alarm, the new tag value that you specify replaces the previous value for that tag.

You can associate as many as 50 tags with a CloudWatch Logs resource.

## Request Syntax
<a name="API_TagResource_RequestSyntax"></a>

```
{
   "resourceArn": "string",
   "tags": { 
      "string" : "string" 
   }
}
```

## Request Parameters
<a name="API_TagResource_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [resourceArn](#API_TagResource_RequestSyntax) **   <a name="CWL-TagResource-request-resourceArn"></a>
The ARN of the resource that you're adding tags to.  
The ARN format of a log group is `arn:aws:logs:Region:account-id:log-group:log-group-name `   
The ARN format of a destination is `arn:aws:logs:Region:account-id:destination:destination-name `   
For more information about ARN format, see [CloudWatch Logs resources and operations](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html).  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 1011.  
Pattern: `[\w+=/:,.@-]*`   
Required: Yes

 ** [tags](#API_TagResource_RequestSyntax) **   <a name="CWL-TagResource-request-tags"></a>
The list of key-value pairs to associate with the resource.  
Type: String to string map  
Map Entries: Maximum number of 50 items.  
Key Length Constraints: Minimum length of 1. Maximum length of 128.  
Key Pattern: `^([\p{L}\p{Z}\p{N}_.:/=+\-@]+)$`   
Value Length Constraints: Maximum length of 256.  
Value Pattern: `^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$`   
Required: Yes

## Response Elements
<a name="API_TagResource_ResponseElements"></a>

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

## Errors
<a name="API_TagResource_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** 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

 ** TooManyTagsException **   
A resource can have no more than 50 tags.    
 ** resourceName **   
The name of the resource.
HTTP Status Code: 400

## See Also
<a name="API_TagResource_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/TagResource) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/TagResource) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/TagResource) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/TagResource) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/TagResource) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/TagResource) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/TagResource) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/TagResource) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/TagResource) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/TagResource) 

# TestMetricFilter
<a name="API_TestMetricFilter"></a>

Tests the filter pattern of a metric filter against a sample of log event messages. You can use this operation to validate the correctness of a metric filter pattern.

## Request Syntax
<a name="API_TestMetricFilter_RequestSyntax"></a>

```
{
   "filterPattern": "string",
   "logEventMessages": [ "string" ]
}
```

## Request Parameters
<a name="API_TestMetricFilter_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [filterPattern](#API_TestMetricFilter_RequestSyntax) **   <a name="CWL-TestMetricFilter-request-filterPattern"></a>
A symbolic description of how CloudWatch Logs should interpret the data in each log event. For example, a log event can contain timestamps, IP addresses, strings, and so on. You use the filter pattern to specify what to look for in the log event message.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Required: Yes

 ** [logEventMessages](#API_TestMetricFilter_RequestSyntax) **   <a name="CWL-TestMetricFilter-request-logEventMessages"></a>
The log event messages to test.  
Type: Array of strings  
Array Members: Minimum number of 1 item. Maximum number of 50 items.  
Length Constraints: Minimum length of 1.  
Required: Yes

## Response Syntax
<a name="API_TestMetricFilter_ResponseSyntax"></a>

```
{
   "matches": [ 
      { 
         "eventMessage": "string",
         "eventNumber": number,
         "extractedValues": { 
            "string" : "string" 
         }
      }
   ]
}
```

## Response Elements
<a name="API_TestMetricFilter_ResponseElements"></a>

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

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

 ** [matches](#API_TestMetricFilter_ResponseSyntax) **   <a name="CWL-TestMetricFilter-response-matches"></a>
The matched events.  
Type: Array of [MetricFilterMatchRecord](API_MetricFilterMatchRecord.md) objects

## Errors
<a name="API_TestMetricFilter_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** ServiceUnavailableException **   
The service cannot complete the request.  
HTTP Status Code: 500

## Examples
<a name="API_TestMetricFilter_Examples"></a>

### To test a metric filter pattern on Apache access.log events
<a name="API_TestMetricFilter_Example_1"></a>

The following example tests the specified metric filter pattern.

#### Sample Request
<a name="API_TestMetricFilter_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.TestMetricFilter
{
  "filterPattern": "[ip, identity, user_id, timestamp, request, status_code, size]",
  "logEventMessages": [
    "127.0.0.1 - frank [10/Oct/2000:13:25:15 -0700] \"GET /apache_pb.gif HTTP/1.0\" 200 1534",
    "127.0.0.1 - frank [10/Oct/2000:13:35:22 -0700] \"GET /apache_pb.gif HTTP/1.0\" 500 5324",
    "127.0.0.1 - frank [10/Oct/2000:13:50:35 -0700] \"GET /apache_pb.gif HTTP/1.0\" 200 4355"
  ]
}
```

#### Sample Response
<a name="API_TestMetricFilter_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
  "matches": [
    {
      "eventNumber": 0,
      "eventMessage": "127.0.0.1 - frank [10/Oct/2000:13:25:15 -0700] \"GET /apache_pb.gif HTTP/1.0\" 200 1534",
      "extractedValues": {
        "$status_code": "200",
        "$identity": "-",
        "$request": "GET /apache_pb.gif HTTP/1.0",
        "$size": "1534,",
        "$user_id": "frank",
        "$ip": "127.0.0.1",
        "$timestamp": "10/Oct/2000:13:25:15 -0700"
      }
    },
    {
      "eventNumber": 1,
      "eventMessage": "127.0.0.1 - frank [10/Oct/2000:13:35:22 -0700] \"GET /apache_pb.gif HTTP/1.0\" 500 5324",
      "extractedValues": {
        "$status_code": "500",
        "$identity": "-",
        "$request": "GET /apache_pb.gif HTTP/1.0",
        "$size": "5324,",
        "$user_id": "frank",
        "$ip": "127.0.0.1",
        "$timestamp": "10/Oct/2000:13:35:22 -0700"
      }
    },
    {
      "eventNumber": 2,
      "eventMessage": "127.0.0.1 - frank [10/Oct/2000:13:50:35 -0700] \"GET /apache_pb.gif HTTP/1.0\" 200 4355",
      "extractedValues": {
        "$status_code": "200",
        "$identity": "-",
        "$request": "GET /apache_pb.gif HTTP/1.0",
        "$size": "4355",
        "$user_id": "frank",
        "$ip": "127.0.0.1",
        "$timestamp": "10/Oct/2000:13:50:35 -0700"
      }
    }
  ]
}
```

### To test a metric filter pattern on Apache access.log events without specifying all the fields
<a name="API_TestMetricFilter_Example_2"></a>

The following example tests the specified metric filter pattern.

#### Sample Request
<a name="API_TestMetricFilter_Example_2_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.TestMetricFilter
{
  "filterPattern": "[..., size]",
  "logEventMessages": [
    "127.0.0.1 - frank [10/Oct/2000:13:25:15 -0700] \"GET /apache_pb.gif HTTP/1.0\" 200 1534",
    "127.0.0.1 - frank [10/Oct/2000:13:35:22 -0700] \"GET /apache_pb.gif HTTP/1.0\" 500 5324",
    "127.0.0.1 - frank [10/Oct/2000:13:50:35 -0700] \"GET /apache_pb.gif HTTP/1.0\" 200 4355"
  ]
}
```

#### Sample Response
<a name="API_TestMetricFilter_Example_2_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
  "matches": [
    {
      "eventNumber": 0,
      "eventMessage": "127.0.0.1 - frank [10/Oct/2000:13:25:15 -0700] \"GET /apache_pb.gif HTTP/1.0\" 200 1534",
      "extractedValues": {
        "$size": "1534",
        "$6": "200",
        "$4": "10/Oct/2000:13:25:15 -0700",
        "$5": "GET /apache_pb.gif HTTP/1.0",
        "$2": "-",
        "$3": "frank",
        "$1": "127.0.0.1"
      }
    },
    {
      "eventNumber": 1,
      "eventMessage": "127.0.0.1 - frank [10/Oct/2000:13:35:22 -0700] \"GET /apache_pb.gif HTTP/1.0\" 500 5324",
      "extractedValues": {
        "$size": "5324",
        "$6": "500",
        "$4": "10/Oct/2000:13:35:22 -0700",
        "$5": "GET /apache_pb.gif HTTP/1.0",
        "$2": "-",
        "$3": "frank",
        "$1": "127.0.0.1"
      }
    },
    {
      "eventNumber": 2,
      "eventMessage": "127.0.0.1 - frank [10/Oct/2000:13:50:35 -0700] \"GET /apache_pb.gif HTTP/1.0\" 200 4355",
      "extractedValues": {
        "$size": "4355",
        "$6": "200",
        "$4": "10/Oct/2000:13:50:35 -0700",
        "$5": "GET /apache_pb.gif HTTP/1.0",
        "$2": "-",
        "$3": "frank",
        "$1": "127.0.0.1"
      }
    }
  ]
}
```

### To test a metric filter pattern on Apache access.log events without specifying any fields
<a name="API_TestMetricFilter_Example_3"></a>

The following example tests the specified metric filter pattern.

#### Sample Request
<a name="API_TestMetricFilter_Example_3_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.TestMetricFilter
{
  "filterPattern": "[]",
  "logEventMessages": [
    "127.0.0.1 - frank [10/Oct/2000:13:25:15 -0700] \"GET /apache_pb.gif HTTP/1.0\" 200 1534",
    "127.0.0.1 - frank [10/Oct/2000:13:35:22 -0700] \"GET /apache_pb.gif HTTP/1.0\" 500 5324",
    "127.0.0.1 - frank [10/Oct/2000:13:50:35 -0700] \"GET /apache_pb.gif HTTP/1.0\" 200 4355"
  ]
}
```

#### Sample Response
<a name="API_TestMetricFilter_Example_3_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
  "matches": [
    {
      "eventNumber": 0,
      "eventMessage": "127.0.0.1 - frank [10/Oct/2000:13:25:15 -0700] \"GET /apache_pb.gif HTTP/1.0\" 200 1534",
      "extractedValues": {
        "$7": "1534",
        "$6": "200",
        "$4": "10/Oct/2000:13:25:15 -0700",
        "$5": "GET /apache_pb.gif HTTP/1.0",
        "$2": "-",
        "$3": "frank",
        "$1": "127.0.0.1"
      }
    },
    {
      "eventNumber": 1,
      "eventMessage": "127.0.0.1 - frank [10/Oct/2000:13:35:22 -0700] \"GET /apache_pb.gif HTTP/1.0\" 500 5324",
      "extractedValues": {
        "$7": "5324",
        "$6": "500",
        "$4": "10/Oct/2000:13:35:22 -0700",
        "$5": "GET /apache_pb.gif HTTP/1.0",
        "$2": "-",
        "$3": "frank",
        "$1": "127.0.0.1"
      }
    },
    {
      "eventNumber": 2,
      "eventMessage": "127.0.0.1 - frank [10/Oct/2000:13:50:35 -0700] \"GET /apache_pb.gif HTTP/1.0\" 200 4355",
      "extractedValues": {
        "$7": "4355",
        "$6": "200",
        "$4": "10/Oct/2000:13:50:35 -0700",
        "$5": "GET /apache_pb.gif HTTP/1.0",
        "$2": "-",
        "$3": "frank",
        "$1": "127.0.0.1"
      }
    }
  ]
}
```

### To test a metric filter pattern that matches successful requests in Apache access.log events
<a name="API_TestMetricFilter_Example_4"></a>

The following example tests the specified metric filter pattern.

#### Sample Request
<a name="API_TestMetricFilter_Example_4_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.TestMetricFilter
{
  "filterPattern": "[..., status_code=200, size]",
  "logEventMessages": [
    "127.0.0.1 - frank [10/Oct/2000:13:25:15 -0700] \"GET /apache_pb.gif HTTP/1.0\" 200 1534",
    "127.0.0.1 - frank [10/Oct/2000:13:35:22 -0700] \"GET /apache_pb.gif HTTP/1.0\" 500 5324",
    "127.0.0.1 - frank [10/Oct/2000:13:50:35 -0700] \"GET /apache_pb.gif HTTP/1.0\" 200 4355"
  ]
}
```

#### Sample Response
<a name="API_TestMetricFilter_Example_4_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
  "matches": [
    {
      "eventNumber": 0,
      "eventMessage": "127.0.0.1 - frank [10/Oct/2000:13:25:15 -0700] \"GET /apache_pb.gif HTTP/1.0\" 200 1534",
      "extractedValues": {
        "$status_code": "200",
        "$size": "1534",
        "$4": "10/Oct/2000:13:25:15 -0700",
        "$5": "GET /apache_pb.gif HTTP/1.0",
        "$2": "-",
        "$3": "frank",
        "$1": "127.0.0.1"
      }
    },
    {
      "eventNumber": 2,
      "eventMessage": "127.0.0.1 - frank [10/Oct/2000:13:50:35 -0700] \"GET /apache_pb.gif HTTP/1.0\" 200 4355",
      "extractedValues": {
        "$status_code": "200",
        "$size": "4355",
        "$4": "10/Oct/2000:13:50:35 -0700",
        "$5": "GET /apache_pb.gif HTTP/1.0",
        "$2": "-",
        "$3": "frank",
        "$1": "127.0.0.1"
      }
    }
  ]
}
```

### To test a metric filter pattern that matches 4XX response codes for HTML pages in Apache access.log events
<a name="API_TestMetricFilter_Example_5"></a>

The following example tests the specified metric filter pattern.

#### Sample Request
<a name="API_TestMetricFilter_Example_5_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.TestMetricFilter
{
  "filterPattern": "[..., request=*.html*, status_code=4*,]",
  "logEventMessages": [
    "127.0.0.1 - frank [10/Oct/2000:13:25:15 -0700] \"GET /index.html HTTP/1.0\" 404 1534",
    "127.0.0.1 - frank [10/Oct/2000:13:35:22 -0700] \"GET /about-us/index.html HTTP/1.0\" 200 5324",
    "127.0.0.1 - frank [10/Oct/2000:13:50:35 -0700] \"GET /apache_pb.gif HTTP/1.0\" 404 4355",
    "127.0.0.1 - frank [10/Oct/2000:13:25:15 -0700] \"GET /products/index.html HTTP/1.0\" 400 1534",
  ]
}
```

#### Sample Response
<a name="API_TestMetricFilter_Example_5_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
  "matches": [
    {
      "eventNumber": 0,
      "eventMessage": "127.0.0.1 - frank [10/Oct/2000:13:25:15 -0700] \"GET /index.html HTTP/1.0\" 404 1534",
      "extractedValues": {
        "$status_code": "404",
        "$request": "GET /index.html HTTP/1.0",
        "$7": "1534",
        "$4": "10/Oct/2000:13:25:15 -0700",
        "$2": "-",
        "$3": "frank",
        "$1": "127.0.0.1"
      }
    },
    {
      "eventNumber": 3,
      "eventMessage": "127.0.0.1 - frank [10/Oct/2000:13:25:15 -0700] \"GET /products/index.html HTTP/1.0\" 400 1534",
      "extractedValues": {
        "$status_code": "400",
        "$request": "GET /products/index.html HTTP/1.0",
        "$7": "1534",
        "$4": "10/Oct/2000:13:25:15 -0700",
        "$2": "-",
        "$3": "frank",
        "$1": "127.0.0.1"
      }
    }
  ]
}
```

### To test a metric filter pattern that matches occurrences of "[ERROR]" in log events
<a name="API_TestMetricFilter_Example_6"></a>

The following example tests the specified metric filter pattern.

#### Sample Request
<a name="API_TestMetricFilter_Example_6_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.TestMetricFilter
{
  "filterPattern": "\"[ERROR]\"",
  "logEventMessages": [
    "02 May 2014 00:34:12,525 [INFO] Starting the application",
    "02 May 2014 00:35:14,245 [DEBUG] Database connection established",
    "02 May 2014 00:34:14,663 [INFO] Executing SQL Query",
    "02 May 2014 00:34:16,142 [ERROR] Unhanded exception: InvalidQueryException",
    "02 May 2014 00:34:16,224 [ERROR] Terminating the application"
  ]
}
```

#### Sample Response
<a name="API_TestMetricFilter_Example_6_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
  "matches": [
    {
      "eventNumber": 3,
      "eventMessage": "02 May 2014 00:34:16,142 [ERROR] Unhanded exception: InvalidQueryException",
      "extractedValues": {}
    },
    {
      "eventNumber": 4,
      "eventMessage": "02 May 2014 00:34:16,224 [ERROR] Terminating the application",
      "extractedValues": {}
    }
  ]
}
```

### To test a metric filter pattern that matches occurrences of "[ERROR]" and "Exception" in log events
<a name="API_TestMetricFilter_Example_7"></a>

The following example tests the specified metric filter pattern.

#### Sample Request
<a name="API_TestMetricFilter_Example_7_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.TestMetricFilter
{
  "filterPattern": "\"[ERROR]\" Exception",
  "logEventMessages": [
    "02 May 2014 00:34:12,525 [INFO] Starting the application",
    "02 May 2014 00:35:14,245 [DEBUG] Database connection established",
    "02 May 2014 00:34:14,663 [INFO] Executing SQL Query",
    "02 May 2014 00:34:16,142 [ERROR] Unhanded exception: InvalidQueryException",
    "02 May 2014 00:34:16,224 [ERROR] Terminating the application"
  ]
}
```

#### Sample Response
<a name="API_TestMetricFilter_Example_7_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
  "matches": [
    {
      "eventNumber": 3,
      "eventMessage": "02 May 2014 00:34:16,142 [ERROR] Unhanded exception: InvalidQueryException",
      "extractedValues": {}
    }
  ]
}
```

## See Also
<a name="API_TestMetricFilter_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/TestMetricFilter) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/TestMetricFilter) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/TestMetricFilter) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/TestMetricFilter) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/TestMetricFilter) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/TestMetricFilter) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/TestMetricFilter) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/TestMetricFilter) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/TestMetricFilter) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/TestMetricFilter) 

# TestTransformer
<a name="API_TestTransformer"></a>

Use this operation to test a log transformer. You enter the transformer configuration and a set of log events to test with. The operation responds with an array that includes the original log events and the transformed versions.

## Request Syntax
<a name="API_TestTransformer_RequestSyntax"></a>

```
{
   "logEventMessages": [ "string" ],
   "transformerConfig": [ 
      { 
         "addKeys": { 
            "entries": [ 
               { 
                  "key": "string",
                  "overwriteIfExists": boolean,
                  "value": "string"
               }
            ]
         },
         "copyValue": { 
            "entries": [ 
               { 
                  "overwriteIfExists": boolean,
                  "source": "string",
                  "target": "string"
               }
            ]
         },
         "csv": { 
            "columns": [ "string" ],
            "delimiter": "string",
            "destination": "string",
            "quoteCharacter": "string",
            "source": "string"
         },
         "dateTimeConverter": { 
            "locale": "string",
            "matchPatterns": [ "string" ],
            "source": "string",
            "sourceTimezone": "string",
            "target": "string",
            "targetFormat": "string",
            "targetTimezone": "string"
         },
         "deleteKeys": { 
            "withKeys": [ "string" ]
         },
         "grok": { 
            "match": "string",
            "source": "string"
         },
         "listToMap": { 
            "flatten": boolean,
            "flattenedElement": "string",
            "key": "string",
            "source": "string",
            "target": "string",
            "valueKey": "string"
         },
         "lowerCaseString": { 
            "withKeys": [ "string" ]
         },
         "moveKeys": { 
            "entries": [ 
               { 
                  "overwriteIfExists": boolean,
                  "source": "string",
                  "target": "string"
               }
            ]
         },
         "parseCloudfront": { 
            "source": "string"
         },
         "parseJSON": { 
            "destination": "string",
            "source": "string"
         },
         "parseKeyValue": { 
            "destination": "string",
            "fieldDelimiter": "string",
            "keyPrefix": "string",
            "keyValueDelimiter": "string",
            "nonMatchValue": "string",
            "overwriteIfExists": boolean,
            "source": "string"
         },
         "parsePostgres": { 
            "source": "string"
         },
         "parseRoute53": { 
            "source": "string"
         },
         "parseToOCSF": { 
            "eventSource": "string",
            "mappingVersion": "string",
            "ocsfVersion": "string",
            "source": "string"
         },
         "parseVPC": { 
            "source": "string"
         },
         "parseWAF": { 
            "source": "string"
         },
         "renameKeys": { 
            "entries": [ 
               { 
                  "key": "string",
                  "overwriteIfExists": boolean,
                  "renameTo": "string"
               }
            ]
         },
         "splitString": { 
            "entries": [ 
               { 
                  "delimiter": "string",
                  "source": "string"
               }
            ]
         },
         "substituteString": { 
            "entries": [ 
               { 
                  "from": "string",
                  "source": "string",
                  "to": "string"
               }
            ]
         },
         "trimString": { 
            "withKeys": [ "string" ]
         },
         "typeConverter": { 
            "entries": [ 
               { 
                  "key": "string",
                  "type": "string"
               }
            ]
         },
         "upperCaseString": { 
            "withKeys": [ "string" ]
         }
      }
   ]
}
```

## Request Parameters
<a name="API_TestTransformer_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [logEventMessages](#API_TestTransformer_RequestSyntax) **   <a name="CWL-TestTransformer-request-logEventMessages"></a>
An array of the raw log events that you want to use to test this transformer.  
Type: Array of strings  
Array Members: Minimum number of 1 item. Maximum number of 50 items.  
Length Constraints: Minimum length of 1.  
Required: Yes

 ** [transformerConfig](#API_TestTransformer_RequestSyntax) **   <a name="CWL-TestTransformer-request-transformerConfig"></a>
This structure contains the configuration of this log transformer that you want to test. A log transformer is an array of processors, where each processor applies one type of transformation to the log events that are ingested.  
Type: Array of [Processor](API_Processor.md) objects  
Array Members: Minimum number of 1 item. Maximum number of 20 items.  
Required: Yes

## Response Syntax
<a name="API_TestTransformer_ResponseSyntax"></a>

```
{
   "transformedLogs": [ 
      { 
         "eventMessage": "string",
         "eventNumber": number,
         "transformedEventMessage": "string"
      }
   ]
}
```

## Response Elements
<a name="API_TestTransformer_ResponseElements"></a>

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

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

 ** [transformedLogs](#API_TestTransformer_ResponseSyntax) **   <a name="CWL-TestTransformer-response-transformedLogs"></a>
An array where each member of the array includes both the original version and the transformed version of one of the log events that you input.  
Type: Array of [TransformedLogRecord](API_TransformedLogRecord.md) objects

## Errors
<a name="API_TestTransformer_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidOperationException **   
The operation is not valid on the specified resource.  
HTTP Status Code: 400

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** ServiceUnavailableException **   
The service cannot complete the request.  
HTTP Status Code: 500

## See Also
<a name="API_TestTransformer_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/TestTransformer) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/TestTransformer) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/TestTransformer) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/TestTransformer) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/TestTransformer) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/TestTransformer) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/TestTransformer) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/TestTransformer) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/TestTransformer) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/TestTransformer) 

# UntagLogGroup
<a name="API_UntagLogGroup"></a>

**Important**  
The UntagLogGroup operation is on the path to deprecation. We recommend that you use [UntagResource](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_UntagResource.html) instead.

Removes the specified tags from the specified log group.

To list the tags for a log group, use [ListTagsForResource](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_ListTagsForResource.html). To add tags, use [TagResource](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_TagResource.html).

When using IAM policies to control tag management for CloudWatch Logs log groups, the condition keys `aws:Resource/key-name` and `aws:TagKeys` cannot be used to restrict which tags users can assign. 

## Request Syntax
<a name="API_UntagLogGroup_RequestSyntax"></a>

```
{
   "logGroupName": "string",
   "tags": [ "string" ]
}
```

## Request Parameters
<a name="API_UntagLogGroup_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [logGroupName](#API_UntagLogGroup_RequestSyntax) **   <a name="CWL-UntagLogGroup-request-logGroupName"></a>
The name of the log group.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 512.  
Pattern: `[\.\-_/#A-Za-z0-9]+`   
Required: Yes

 ** [tags](#API_UntagLogGroup_RequestSyntax) **   <a name="CWL-UntagLogGroup-request-tags"></a>
The tag keys. The corresponding tags are removed from the log group.  
Type: Array of strings  
Array Members: Minimum number of 1 item.  
Length Constraints: Minimum length of 1. Maximum length of 128.  
Pattern: `^([\p{L}\p{Z}\p{N}_.:/=+\-@]+)$`   
Required: Yes

## Response Elements
<a name="API_UntagLogGroup_ResponseElements"></a>

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

## Errors
<a name="API_UntagLogGroup_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** ResourceNotFoundException **   
The specified resource does not exist.  
HTTP Status Code: 400

## Examples
<a name="API_UntagLogGroup_Examples"></a>

### To remove tags from a log group
<a name="API_UntagLogGroup_Example_1"></a>

The following example removes the specified tags for the specified log group.

#### Sample Request
<a name="API_UntagLogGroup_Example_1_Request"></a>

```
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>
User-Agent: <UserAgentString>
Accept: application/json
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Logs_20140328.UntagLogGroup
{
  "logGroupName": "my-log-group",
  "tags": {"Project", "Environment"}
}
```

#### Sample Response
<a name="API_UntagLogGroup_Example_1_Response"></a>

```
HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
```

## See Also
<a name="API_UntagLogGroup_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/UntagLogGroup) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/UntagLogGroup) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/UntagLogGroup) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/UntagLogGroup) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/UntagLogGroup) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/UntagLogGroup) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/UntagLogGroup) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/UntagLogGroup) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/UntagLogGroup) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/UntagLogGroup) 

# UntagResource
<a name="API_UntagResource"></a>

Removes one or more tags from the specified resource.

## Request Syntax
<a name="API_UntagResource_RequestSyntax"></a>

```
{
   "resourceArn": "string",
   "tagKeys": [ "string" ]
}
```

## Request Parameters
<a name="API_UntagResource_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [resourceArn](#API_UntagResource_RequestSyntax) **   <a name="CWL-UntagResource-request-resourceArn"></a>
The ARN of the CloudWatch Logs resource that you're removing tags from.  
The ARN format of a log group is `arn:aws:logs:Region:account-id:log-group:log-group-name `   
The ARN format of a destination is `arn:aws:logs:Region:account-id:destination:destination-name `   
For more information about ARN format, see [CloudWatch Logs resources and operations](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html).  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 1011.  
Pattern: `[\w+=/:,.@-]*`   
Required: Yes

 ** [tagKeys](#API_UntagResource_RequestSyntax) **   <a name="CWL-UntagResource-request-tagKeys"></a>
The list of tag keys to remove from the resource.  
Type: Array of strings  
Array Members: Minimum number of 0 items. Maximum number of 50 items.  
Length Constraints: Minimum length of 1. Maximum length of 128.  
Pattern: `^([\p{L}\p{Z}\p{N}_.:/=+\-@]+)$`   
Required: Yes

## Response Elements
<a name="API_UntagResource_ResponseElements"></a>

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

## Errors
<a name="API_UntagResource_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** 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

## See Also
<a name="API_UntagResource_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/UntagResource) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/UntagResource) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/UntagResource) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/UntagResource) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/UntagResource) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/UntagResource) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/UntagResource) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/UntagResource) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/UntagResource) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/UntagResource) 

# UpdateAnomaly
<a name="API_UpdateAnomaly"></a>

Use this operation to *suppress* anomaly detection for a specified anomaly or pattern. If you suppress an anomaly, CloudWatch Logs won't report new occurrences of that anomaly and won't update that anomaly with new data. If you suppress a pattern, CloudWatch Logs won't report any anomalies related to that pattern.

You must specify either `anomalyId` or `patternId`, but you can't specify both parameters in the same operation.

If you have previously used this operation to suppress detection of a pattern or anomaly, you can use it again to cause CloudWatch Logs to end the suppression. To do this, use this operation and specify the anomaly or pattern to stop suppressing, and omit the `suppressionType` and `suppressionPeriod` parameters.

## Request Syntax
<a name="API_UpdateAnomaly_RequestSyntax"></a>

```
{
   "anomalyDetectorArn": "string",
   "anomalyId": "string",
   "baseline": boolean,
   "patternId": "string",
   "suppressionPeriod": { 
      "suppressionUnit": "string",
      "value": number
   },
   "suppressionType": "string"
}
```

## Request Parameters
<a name="API_UpdateAnomaly_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [anomalyDetectorArn](#API_UpdateAnomaly_RequestSyntax) **   <a name="CWL-UpdateAnomaly-request-anomalyDetectorArn"></a>
The ARN of the anomaly detector that this operation is to act on.  
Type: String  
Length Constraints: Minimum length of 1.  
Pattern: `[\w#+=/:,.@-]*`   
Required: Yes

 ** [anomalyId](#API_UpdateAnomaly_RequestSyntax) **   <a name="CWL-UpdateAnomaly-request-anomalyId"></a>
If you are suppressing or unsuppressing an anomaly, specify its unique ID here. You can find anomaly IDs by using the [ListAnomalies](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_ListAnomalies.html) operation.  
Type: String  
Length Constraints: Fixed length of 36.  
Required: No

 ** [baseline](#API_UpdateAnomaly_RequestSyntax) **   <a name="CWL-UpdateAnomaly-request-baseline"></a>
Set this to `true` to prevent CloudWatch Logs from displaying this behavior as an anomaly in the future. The behavior is then treated as baseline behavior. However, if similar but more severe occurrences of this behavior occur in the future, those will still be reported as anomalies.   
The default is `false`   
Type: Boolean  
Required: No

 ** [patternId](#API_UpdateAnomaly_RequestSyntax) **   <a name="CWL-UpdateAnomaly-request-patternId"></a>
If you are suppressing or unsuppressing an pattern, specify its unique ID here. You can find pattern IDs by using the [ListAnomalies](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_ListAnomalies.html) operation.  
Type: String  
Length Constraints: Fixed length of 32.  
Required: No

 ** [suppressionPeriod](#API_UpdateAnomaly_RequestSyntax) **   <a name="CWL-UpdateAnomaly-request-suppressionPeriod"></a>
If you are temporarily suppressing an anomaly or pattern, use this structure to specify how long the suppression is to last.  
Type: [SuppressionPeriod](API_SuppressionPeriod.md) object  
Required: No

 ** [suppressionType](#API_UpdateAnomaly_RequestSyntax) **   <a name="CWL-UpdateAnomaly-request-suppressionType"></a>
Use this to specify whether the suppression to be temporary or infinite. If you specify `LIMITED`, you must also specify a `suppressionPeriod`. If you specify `INFINITE`, any value for `suppressionPeriod` is ignored.   
Type: String  
Valid Values: `LIMITED | INFINITE`   
Required: No

## Response Elements
<a name="API_UpdateAnomaly_ResponseElements"></a>

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

## Errors
<a name="API_UpdateAnomaly_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
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

## See Also
<a name="API_UpdateAnomaly_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/UpdateAnomaly) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/UpdateAnomaly) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/UpdateAnomaly) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/UpdateAnomaly) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/UpdateAnomaly) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/UpdateAnomaly) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/UpdateAnomaly) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/UpdateAnomaly) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/UpdateAnomaly) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/UpdateAnomaly) 

# UpdateDeliveryConfiguration
<a name="API_UpdateDeliveryConfiguration"></a>

Use this operation to update the configuration of a [delivery](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_Delivery.html) to change either the S3 path pattern or the format of the delivered logs. You can't use this operation to change the source or destination of the delivery.

## Request Syntax
<a name="API_UpdateDeliveryConfiguration_RequestSyntax"></a>

```
{
   "fieldDelimiter": "string",
   "id": "string",
   "recordFields": [ "string" ],
   "s3DeliveryConfiguration": { 
      "enableHiveCompatiblePath": boolean,
      "suffixPath": "string"
   }
}
```

## Request Parameters
<a name="API_UpdateDeliveryConfiguration_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [fieldDelimiter](#API_UpdateDeliveryConfiguration_RequestSyntax) **   <a name="CWL-UpdateDeliveryConfiguration-request-fieldDelimiter"></a>
The field delimiter to use between record fields when the final output format of a delivery is in `Plain`, `W3C`, or `Raw` format.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 5.  
Required: No

 ** [id](#API_UpdateDeliveryConfiguration_RequestSyntax) **   <a name="CWL-UpdateDeliveryConfiguration-request-id"></a>
The ID of the delivery to be updated by this request.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 64.  
Pattern: `^[0-9A-Za-z]+$`   
Required: Yes

 ** [recordFields](#API_UpdateDeliveryConfiguration_RequestSyntax) **   <a name="CWL-UpdateDeliveryConfiguration-request-recordFields"></a>
The list of record fields to be delivered to the destination, in order. If the delivery's log source has mandatory fields, they must be included in this list.  
Type: Array of strings  
Array Members: Minimum number of 0 items. Maximum number of 128 items.  
Length Constraints: Minimum length of 1. Maximum length of 64.  
Required: No

 ** [s3DeliveryConfiguration](#API_UpdateDeliveryConfiguration_RequestSyntax) **   <a name="CWL-UpdateDeliveryConfiguration-request-s3DeliveryConfiguration"></a>
This structure contains parameters that are valid only when the delivery's delivery destination is an S3 bucket.  
Type: [S3DeliveryConfiguration](API_S3DeliveryConfiguration.md) object  
Required: No

## Response Elements
<a name="API_UpdateDeliveryConfiguration_ResponseElements"></a>

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

## Errors
<a name="API_UpdateDeliveryConfiguration_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have sufficient permissions to perform this action.  
HTTP Status Code: 400

 ** ConflictException **   
This operation attempted to create a resource that already exists.  
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

 ** ThrottlingException **   
The request was throttled because of quota limits.  
HTTP Status Code: 400

 ** ValidationException **   
One of the parameters for the request is not valid.  
HTTP Status Code: 400

## See Also
<a name="API_UpdateDeliveryConfiguration_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/UpdateDeliveryConfiguration) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/UpdateDeliveryConfiguration) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/UpdateDeliveryConfiguration) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/UpdateDeliveryConfiguration) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/UpdateDeliveryConfiguration) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/UpdateDeliveryConfiguration) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/UpdateDeliveryConfiguration) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/UpdateDeliveryConfiguration) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/UpdateDeliveryConfiguration) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/UpdateDeliveryConfiguration) 

# UpdateLogAnomalyDetector
<a name="API_UpdateLogAnomalyDetector"></a>

Updates an existing log anomaly detector.

## Request Syntax
<a name="API_UpdateLogAnomalyDetector_RequestSyntax"></a>

```
{
   "anomalyDetectorArn": "string",
   "anomalyVisibilityTime": number,
   "enabled": boolean,
   "evaluationFrequency": "string",
   "filterPattern": "string"
}
```

## Request Parameters
<a name="API_UpdateLogAnomalyDetector_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [anomalyDetectorArn](#API_UpdateLogAnomalyDetector_RequestSyntax) **   <a name="CWL-UpdateLogAnomalyDetector-request-anomalyDetectorArn"></a>
The ARN of the anomaly detector that you want to update.  
Type: String  
Length Constraints: Minimum length of 1.  
Pattern: `[\w#+=/:,.@-]*`   
Required: Yes

 ** [anomalyVisibilityTime](#API_UpdateLogAnomalyDetector_RequestSyntax) **   <a name="CWL-UpdateLogAnomalyDetector-request-anomalyVisibilityTime"></a>
The number of days to use as the life cycle of anomalies. After this time, anomalies are automatically baselined and the anomaly detector model will treat new occurrences of similar event as normal. Therefore, if you do not correct the cause of an anomaly during this time, it will be considered normal going forward and will not be detected.  
Type: Long  
Valid Range: Minimum value of 7. Maximum value of 90.  
Required: No

 ** [enabled](#API_UpdateLogAnomalyDetector_RequestSyntax) **   <a name="CWL-UpdateLogAnomalyDetector-request-enabled"></a>
Use this parameter to pause or restart the anomaly detector.   
Type: Boolean  
Required: Yes

 ** [evaluationFrequency](#API_UpdateLogAnomalyDetector_RequestSyntax) **   <a name="CWL-UpdateLogAnomalyDetector-request-evaluationFrequency"></a>
Specifies how often the anomaly detector runs and look for anomalies. Set this value according to the frequency that the log group receives new logs. For example, if the log group receives new log events every 10 minutes, then setting `evaluationFrequency` to `FIFTEEN_MIN` might be appropriate.  
Type: String  
Valid Values: `ONE_MIN | FIVE_MIN | TEN_MIN | FIFTEEN_MIN | THIRTY_MIN | ONE_HOUR`   
Required: No

 ** [filterPattern](#API_UpdateLogAnomalyDetector_RequestSyntax) **   <a name="CWL-UpdateLogAnomalyDetector-request-filterPattern"></a>
A symbolic description of how CloudWatch Logs should interpret the data in each log event. For example, a log event can contain timestamps, IP addresses, strings, and so on. You use the filter pattern to specify what to look for in the log event message.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Required: No

## Response Elements
<a name="API_UpdateLogAnomalyDetector_ResponseElements"></a>

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

## Errors
<a name="API_UpdateLogAnomalyDetector_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidParameterException **   
A parameter is specified incorrectly.  
HTTP Status Code: 400

 ** OperationAbortedException **   
Multiple concurrent requests to update the same resource were in conflict.  
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

## See Also
<a name="API_UpdateLogAnomalyDetector_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/UpdateLogAnomalyDetector) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/UpdateLogAnomalyDetector) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/UpdateLogAnomalyDetector) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/UpdateLogAnomalyDetector) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/UpdateLogAnomalyDetector) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/UpdateLogAnomalyDetector) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/UpdateLogAnomalyDetector) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/UpdateLogAnomalyDetector) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/UpdateLogAnomalyDetector) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/UpdateLogAnomalyDetector) 

# UpdateLookupTable
<a name="API_UpdateLookupTable"></a>

Updates an existing lookup table by replacing all of its CSV content. After the update completes, queries that use this table will use the new data.

This is a full replacement operation. All existing content is replaced with the new CSV data.

## Request Syntax
<a name="API_UpdateLookupTable_RequestSyntax"></a>

```
{
   "description": "string",
   "kmsKeyId": "string",
   "lookupTableArn": "string",
   "tableBody": "string"
}
```

## Request Parameters
<a name="API_UpdateLookupTable_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [description](#API_UpdateLookupTable_RequestSyntax) **   <a name="CWL-UpdateLookupTable-request-description"></a>
An updated description of the lookup table.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1024.  
Required: No

 ** [kmsKeyId](#API_UpdateLookupTable_RequestSyntax) **   <a name="CWL-UpdateLookupTable-request-kmsKeyId"></a>
The ARN of the AWS KMS key to use to encrypt the lookup table data. You can use this parameter to add, update, or remove the KMS key. To remove the KMS key and use an AWS-owned key instead, specify an empty string.  
Type: String  
Length Constraints: Maximum length of 256.  
Required: No

 ** [lookupTableArn](#API_UpdateLookupTable_RequestSyntax) **   <a name="CWL-UpdateLookupTable-request-lookupTableArn"></a>
The ARN of the lookup table to update.  
Type: String  
Required: Yes

 ** [tableBody](#API_UpdateLookupTable_RequestSyntax) **   <a name="CWL-UpdateLookupTable-request-tableBody"></a>
The new CSV content to replace the existing data. The first row must be a header row with column names. The content must use UTF-8 encoding and not exceed 10 MB.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 10485760.  
Required: Yes

## Response Syntax
<a name="API_UpdateLookupTable_ResponseSyntax"></a>

```
{
   "lastUpdatedTime": number,
   "lookupTableArn": "string"
}
```

## Response Elements
<a name="API_UpdateLookupTable_ResponseElements"></a>

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

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

 ** [lastUpdatedTime](#API_UpdateLookupTable_ResponseSyntax) **   <a name="CWL-UpdateLookupTable-response-lastUpdatedTime"></a>
The time when the lookup table was last updated, expressed as the number of milliseconds after `Jan 1, 1970 00:00:00 UTC`.  
Type: Long  
Valid Range: Minimum value of 0.

 ** [lookupTableArn](#API_UpdateLookupTable_ResponseSyntax) **   <a name="CWL-UpdateLookupTable-response-lookupTableArn"></a>
The ARN of the lookup table that was updated.  
Type: String

## Errors
<a name="API_UpdateLookupTable_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have sufficient permissions to perform this action.  
HTTP Status Code: 400

 ** 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

 ** ValidationException **   
One of the parameters for the request is not valid.  
HTTP Status Code: 400

## See Also
<a name="API_UpdateLookupTable_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/UpdateLookupTable) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/UpdateLookupTable) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/UpdateLookupTable) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/UpdateLookupTable) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/UpdateLookupTable) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/UpdateLookupTable) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/UpdateLookupTable) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/UpdateLookupTable) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/UpdateLookupTable) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/UpdateLookupTable) 

# UpdateScheduledQuery
<a name="API_UpdateScheduledQuery"></a>

Updates an existing scheduled query with new configuration. This operation uses PUT semantics, allowing modification of query parameters, schedule, and destinations.

## Request Syntax
<a name="API_UpdateScheduledQuery_RequestSyntax"></a>

```
{
   "description": "string",
   "destinationConfiguration": { 
      "s3Configuration": { 
         "destinationIdentifier": "string",
         "kmsKeyId": "string",
         "ownerAccountId": "string",
         "roleArn": "string"
      }
   },
   "executionRoleArn": "string",
   "identifier": "string",
   "logGroupIdentifiers": [ "string" ],
   "queryLanguage": "string",
   "queryString": "string",
   "scheduleEndTime": number,
   "scheduleExpression": "string",
   "scheduleStartTime": number,
   "startTimeOffset": number,
   "state": "string",
   "timezone": "string"
}
```

## Request Parameters
<a name="API_UpdateScheduledQuery_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [description](#API_UpdateScheduledQuery_RequestSyntax) **   <a name="CWL-UpdateScheduledQuery-request-description"></a>
An updated description for the scheduled query.  
Type: String  
Length Constraints: Maximum length of 1024.  
Required: No

 ** [destinationConfiguration](#API_UpdateScheduledQuery_RequestSyntax) **   <a name="CWL-UpdateScheduledQuery-request-destinationConfiguration"></a>
The updated configuration for where to deliver query results.  
Type: [DestinationConfiguration](API_DestinationConfiguration.md) object  
Required: No

 ** [executionRoleArn](#API_UpdateScheduledQuery_RequestSyntax) **   <a name="CWL-UpdateScheduledQuery-request-executionRoleArn"></a>
The updated ARN of the IAM role that grants permissions to execute the query and deliver results.  
Type: String  
Length Constraints: Minimum length of 1.  
Required: Yes

 ** [identifier](#API_UpdateScheduledQuery_RequestSyntax) **   <a name="CWL-UpdateScheduledQuery-request-identifier"></a>
The ARN or name of the scheduled query to update.  
Type: String  
Pattern: `[\w#+=/:,.@-]*`   
Required: Yes

 ** [logGroupIdentifiers](#API_UpdateScheduledQuery_RequestSyntax) **   <a name="CWL-UpdateScheduledQuery-request-logGroupIdentifiers"></a>
The updated array of log group names or ARNs to query.  
Type: Array of strings  
Array Members: Minimum number of 1 item. Maximum number of 50 items.  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Pattern: `[\w#+=/:,.@-]*`   
Required: No

 ** [queryLanguage](#API_UpdateScheduledQuery_RequestSyntax) **   <a name="CWL-UpdateScheduledQuery-request-queryLanguage"></a>
The updated query language for the scheduled query.  
Type: String  
Valid Values: `CWLI | SQL | PPL`   
Required: Yes

 ** [queryString](#API_UpdateScheduledQuery_RequestSyntax) **   <a name="CWL-UpdateScheduledQuery-request-queryString"></a>
The updated query string to execute.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 10000.  
Required: Yes

 ** [scheduleEndTime](#API_UpdateScheduledQuery_RequestSyntax) **   <a name="CWL-UpdateScheduledQuery-request-scheduleEndTime"></a>
The updated end time for the scheduled query in Unix epoch format.  
Type: Long  
Valid Range: Minimum value of 0.  
Required: No

 ** [scheduleExpression](#API_UpdateScheduledQuery_RequestSyntax) **   <a name="CWL-UpdateScheduledQuery-request-scheduleExpression"></a>
The updated cron expression that defines when the scheduled query runs.  
Type: String  
Length Constraints: Maximum length of 256.  
Required: Yes

 ** [scheduleStartTime](#API_UpdateScheduledQuery_RequestSyntax) **   <a name="CWL-UpdateScheduledQuery-request-scheduleStartTime"></a>
The updated start time for the scheduled query in Unix epoch format.  
Type: Long  
Valid Range: Minimum value of 0.  
Required: No

 ** [startTimeOffset](#API_UpdateScheduledQuery_RequestSyntax) **   <a name="CWL-UpdateScheduledQuery-request-startTimeOffset"></a>
The updated time offset in seconds that defines the lookback period for the query.  
Type: Long  
Required: No

 ** [state](#API_UpdateScheduledQuery_RequestSyntax) **   <a name="CWL-UpdateScheduledQuery-request-state"></a>
The updated state of the scheduled query.  
Type: String  
Valid Values: `ENABLED | DISABLED`   
Required: No

 ** [timezone](#API_UpdateScheduledQuery_RequestSyntax) **   <a name="CWL-UpdateScheduledQuery-request-timezone"></a>
The updated timezone for evaluating the schedule expression.  
Type: String  
Length Constraints: Minimum length of 1.  
Required: No

## Response Syntax
<a name="API_UpdateScheduledQuery_ResponseSyntax"></a>

```
{
   "creationTime": number,
   "description": "string",
   "destinationConfiguration": { 
      "s3Configuration": { 
         "destinationIdentifier": "string",
         "kmsKeyId": "string",
         "ownerAccountId": "string",
         "roleArn": "string"
      }
   },
   "executionRoleArn": "string",
   "lastExecutionStatus": "string",
   "lastTriggeredTime": number,
   "lastUpdatedTime": number,
   "logGroupIdentifiers": [ "string" ],
   "name": "string",
   "queryLanguage": "string",
   "queryString": "string",
   "scheduledQueryArn": "string",
   "scheduleEndTime": number,
   "scheduleExpression": "string",
   "scheduleStartTime": number,
   "startTimeOffset": number,
   "state": "string",
   "timezone": "string"
}
```

## Response Elements
<a name="API_UpdateScheduledQuery_ResponseElements"></a>

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

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

 ** [creationTime](#API_UpdateScheduledQuery_ResponseSyntax) **   <a name="CWL-UpdateScheduledQuery-response-creationTime"></a>
The timestamp when the scheduled query was originally created.  
Type: Long  
Valid Range: Minimum value of 0.

 ** [description](#API_UpdateScheduledQuery_ResponseSyntax) **   <a name="CWL-UpdateScheduledQuery-response-description"></a>
The description of the updated scheduled query.  
Type: String  
Length Constraints: Maximum length of 1024.

 ** [destinationConfiguration](#API_UpdateScheduledQuery_ResponseSyntax) **   <a name="CWL-UpdateScheduledQuery-response-destinationConfiguration"></a>
The destination configuration of the updated scheduled query.  
Type: [DestinationConfiguration](API_DestinationConfiguration.md) object

 ** [executionRoleArn](#API_UpdateScheduledQuery_ResponseSyntax) **   <a name="CWL-UpdateScheduledQuery-response-executionRoleArn"></a>
The execution role ARN of the updated scheduled query.  
Type: String  
Length Constraints: Minimum length of 1.

 ** [lastExecutionStatus](#API_UpdateScheduledQuery_ResponseSyntax) **   <a name="CWL-UpdateScheduledQuery-response-lastExecutionStatus"></a>
The status of the most recent execution of the updated scheduled query.  
Type: String  
Valid Values: `Running | InvalidQuery | Complete | Failed | Timeout` 

 ** [lastTriggeredTime](#API_UpdateScheduledQuery_ResponseSyntax) **   <a name="CWL-UpdateScheduledQuery-response-lastTriggeredTime"></a>
The timestamp when the updated scheduled query was last executed.  
Type: Long  
Valid Range: Minimum value of 0.

 ** [lastUpdatedTime](#API_UpdateScheduledQuery_ResponseSyntax) **   <a name="CWL-UpdateScheduledQuery-response-lastUpdatedTime"></a>
The timestamp when the scheduled query was last updated.  
Type: Long  
Valid Range: Minimum value of 0.

 ** [logGroupIdentifiers](#API_UpdateScheduledQuery_ResponseSyntax) **   <a name="CWL-UpdateScheduledQuery-response-logGroupIdentifiers"></a>
The log groups queried by the updated scheduled query.  
Type: Array of strings  
Array Members: Minimum number of 1 item. Maximum number of 50 items.  
Length Constraints: Minimum length of 1. Maximum length of 2048.  
Pattern: `[\w#+=/:,.@-]*` 

 ** [name](#API_UpdateScheduledQuery_ResponseSyntax) **   <a name="CWL-UpdateScheduledQuery-response-name"></a>
The name of the updated scheduled query.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 255.  
Pattern: `^[a-zA-Z0-9_\-/.#]+$` 

 ** [queryLanguage](#API_UpdateScheduledQuery_ResponseSyntax) **   <a name="CWL-UpdateScheduledQuery-response-queryLanguage"></a>
The query language of the updated scheduled query.  
Type: String  
Valid Values: `CWLI | SQL | PPL` 

 ** [queryString](#API_UpdateScheduledQuery_ResponseSyntax) **   <a name="CWL-UpdateScheduledQuery-response-queryString"></a>
The query string of the updated scheduled query.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 10000.

 ** [scheduledQueryArn](#API_UpdateScheduledQuery_ResponseSyntax) **   <a name="CWL-UpdateScheduledQuery-response-scheduledQueryArn"></a>
The ARN of the updated scheduled query.  
Type: String

 ** [scheduleEndTime](#API_UpdateScheduledQuery_ResponseSyntax) **   <a name="CWL-UpdateScheduledQuery-response-scheduleEndTime"></a>
The end time of the updated scheduled query.  
Type: Long  
Valid Range: Minimum value of 0.

 ** [scheduleExpression](#API_UpdateScheduledQuery_ResponseSyntax) **   <a name="CWL-UpdateScheduledQuery-response-scheduleExpression"></a>
The cron expression of the updated scheduled query.  
Type: String  
Length Constraints: Maximum length of 256.

 ** [scheduleStartTime](#API_UpdateScheduledQuery_ResponseSyntax) **   <a name="CWL-UpdateScheduledQuery-response-scheduleStartTime"></a>
The start time of the updated scheduled query.  
Type: Long  
Valid Range: Minimum value of 0.

 ** [startTimeOffset](#API_UpdateScheduledQuery_ResponseSyntax) **   <a name="CWL-UpdateScheduledQuery-response-startTimeOffset"></a>
The time offset of the updated scheduled query.  
Type: Long

 ** [state](#API_UpdateScheduledQuery_ResponseSyntax) **   <a name="CWL-UpdateScheduledQuery-response-state"></a>
The state of the updated scheduled query.  
Type: String  
Valid Values: `ENABLED | DISABLED` 

 ** [timezone](#API_UpdateScheduledQuery_ResponseSyntax) **   <a name="CWL-UpdateScheduledQuery-response-timezone"></a>
The timezone of the updated scheduled query.  
Type: String  
Length Constraints: Minimum length of 1.

## Errors
<a name="API_UpdateScheduledQuery_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You don't have sufficient permissions to perform this action.  
HTTP Status Code: 400

 ** InternalServerException **   
An internal server error occurred while processing the request. This exception is returned when the service encounters an unexpected condition that prevents it from fulfilling the request.  
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The specified resource does not exist.  
HTTP Status Code: 400

 ** ThrottlingException **   
The request was throttled because of quota limits.  
HTTP Status Code: 400

 ** ValidationException **   
One of the parameters for the request is not valid.  
HTTP Status Code: 400

## See Also
<a name="API_UpdateScheduledQuery_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/logs-2014-03-28/UpdateScheduledQuery) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/logs-2014-03-28/UpdateScheduledQuery) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/logs-2014-03-28/UpdateScheduledQuery) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/logs-2014-03-28/UpdateScheduledQuery) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/logs-2014-03-28/UpdateScheduledQuery) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/logs-2014-03-28/UpdateScheduledQuery) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/logs-2014-03-28/UpdateScheduledQuery) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/logs-2014-03-28/UpdateScheduledQuery) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/logs-2014-03-28/UpdateScheduledQuery) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/logs-2014-03-28/UpdateScheduledQuery) 