

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 使用 SDK 的 CloudWatch Logs 動作 AWS SDKs
<a name="service_code_examples_actions"></a>

下列程式碼範例示範如何使用 AWS SDKs 執行個別 CloudWatch Logs 動作。每個範例均包含 GitHub 的連結，您可以在連結中找到設定和執行程式碼的相關說明。

這些摘錄會呼叫 CloudWatch Logs API，是必須在內容中執行之大型程式的程式碼摘錄。您可以在 [使用 SDK 的 CloudWatch Logs 案例 AWS SDKs](service_code_examples_scenarios.md) 中查看內容中的動作。

 下列範例僅包含最常使用的動作。如需完整清單，請參閱《[Amazon CloudWatch Logs API 參考](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/Welcome.html)》。

**Topics**
+ [`AssociateKmsKey`](example_cloudwatch-logs_AssociateKmsKey_section.md)
+ [`CancelExportTask`](example_cloudwatch-logs_CancelExportTask_section.md)
+ [`CreateExportTask`](example_cloudwatch-logs_CreateExportTask_section.md)
+ [`CreateLogGroup`](example_cloudwatch-logs_CreateLogGroup_section.md)
+ [`CreateLogStream`](example_cloudwatch-logs_CreateLogStream_section.md)
+ [`DeleteLogGroup`](example_cloudwatch-logs_DeleteLogGroup_section.md)
+ [`DeleteSubscriptionFilter`](example_cloudwatch-logs_DeleteSubscriptionFilter_section.md)
+ [`DescribeExportTasks`](example_cloudwatch-logs_DescribeExportTasks_section.md)
+ [`DescribeLogGroups`](example_cloudwatch-logs_DescribeLogGroups_section.md)
+ [`DescribeLogStreams`](example_cloudwatch-logs_DescribeLogStreams_section.md)
+ [`DescribeSubscriptionFilters`](example_cloudwatch-logs_DescribeSubscriptionFilters_section.md)
+ [`GetLogEvents`](example_cloudwatch-logs_GetLogEvents_section.md)
+ [`GetQueryResults`](example_cloudwatch-logs_GetQueryResults_section.md)
+ [`PutSubscriptionFilter`](example_cloudwatch-logs_PutSubscriptionFilter_section.md)
+ [`StartLiveTail`](example_cloudwatch-logs_StartLiveTail_section.md)
+ [`StartQuery`](example_cloudwatch-logs_StartQuery_section.md)