

# Code examples for CloudWatch Logs using AWS SDKs
<a name="service_code_examples"></a>

The following code examples show how to use CloudWatch Logs with an AWS software development kit (SDK). 

*Actions* are code excerpts from larger programs and must be run in context. While actions show you how to call individual service functions, you can see actions in context in their related scenarios.

*Scenarios* are code examples that show you how to accomplish specific tasks by calling multiple functions within a service or combined with other AWS services.

For a complete list of AWS SDK developer guides and code examples, see [Using CloudWatch Logs with an AWS SDK](sdk-general-information-section.md). This topic also includes information about getting started and details about previous SDK versions.

**Contents**
+ [Basics](service_code_examples_basics.md)
  + [Actions](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)
+ [Scenarios](service_code_examples_scenarios.md)
  + [Configure Amazon ECS Service Connect](example_ecs_ServiceConnect_085_section.md)
  + [Creating your first Lambda function](example_lambda_GettingStarted_019_section.md)
  + [Run a large query](example_cloudwatch-logs_Scenario_BigQuery_section.md)
  + [Use scheduled events to invoke a Lambda function](example_cross_LambdaScheduledEvents_section.md)