

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 使用对 CloudWatch 日志执行的操作 AWS SDKs
<a name="service_code_examples_actions"></a>

以下代码示例演示了如何使用执行各个 CloudWatch Logs 操作 AWS SDKs。每个示例都包含一个指向的链接 GitHub，您可以在其中找到有关设置和运行代码的说明。

这些摘录调用 CloudWatch Logs API，是必须在上下文中运行的大型程序的代码摘录。您可以在[使用 CloudWatch 日志的场景 AWS SDKs](service_code_examples_scenarios.md)中结合上下文查看操作。

 以下示例仅包括最常用的操作。如需完整列表，请参阅 [Amazon CloudWatch 日志 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)