

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

# 使用 SDK 的 CloudWatch Logs 程式碼範例 AWS SDKs
<a name="service_code_examples"></a>

下列程式碼範例示範如何使用 CloudWatch Logs 搭配 AWS 軟體開發套件 (SDK)。

*Actions* 是大型程式的程式碼摘錄，必須在內容中執行。雖然動作會告訴您如何呼叫個別服務函數，但您可以在其相關情境中查看內容中的動作。

*案例*是向您展示如何呼叫服務中的多個函數或與其他 AWS 服務組合來完成特定任務的程式碼範例。

如需 AWS SDK 開發人員指南和程式碼範例的完整清單，請參閱 [搭配 AWS SDK 使用 CloudWatch Logs](sdk-general-information-section.md)。此主題也包含有關入門的資訊和舊版 SDK 的詳細資訊。

**Contents**
+ [基本概念](service_code_examples_basics.md)
  + [動作](service_code_examples_actions.md)
    + [`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)
+ [案例](service_code_examples_scenarios.md)
  + [設定 Amazon ECS Service Connect](example_ecs_ServiceConnect_085_section.md)
  + [建立您的第一個 Lambda 函數](example_lambda_GettingStarted_019_section.md)
  + [執行大型查詢](example_cloudwatch-logs_Scenario_BigQuery_section.md)
  + [使用排程事件來調用 Lambda 函式](example_cross_LambdaScheduledEvents_section.md)