Skip to content

CloudWatchLogsClient#

Index > CloudWatchLogs > CloudWatchLogsClient

Auto-generated documentation for CloudWatchLogs type annotations stubs module mypy-boto3-logs.

CloudWatchLogsClient#

Type annotations and code completion for boto3.client("logs"). boto3 documentation

# CloudWatchLogsClient usage example

from boto3.session import Session
from mypy_boto3_logs.client import CloudWatchLogsClient

def get_logs_client() -> CloudWatchLogsClient:
    return Session().client("logs")

Exceptions#

boto3 client exceptions are generated in runtime. This class provides code completion for boto3.client("logs").exceptions structure.

# Exceptions.exceptions usage example

client = boto3.client("logs")

try:
    do_something(client)
except (
    client.exceptions.AccessDeniedException,
    client.exceptions.ClientError,
    client.exceptions.ConflictException,
    client.exceptions.DataAlreadyAcceptedException,
    client.exceptions.InvalidOperationException,
    client.exceptions.InvalidParameterException,
    client.exceptions.InvalidSequenceTokenException,
    client.exceptions.LimitExceededException,
    client.exceptions.MalformedQueryException,
    client.exceptions.OperationAbortedException,
    client.exceptions.ResourceAlreadyExistsException,
    client.exceptions.ResourceNotFoundException,
    client.exceptions.ServiceQuotaExceededException,
    client.exceptions.ServiceUnavailableException,
    client.exceptions.SessionStreamingException,
    client.exceptions.SessionTimeoutException,
    client.exceptions.ThrottlingException,
    client.exceptions.TooManyTagsException,
    client.exceptions.UnrecognizedClientException,
    client.exceptions.ValidationException,
) as e:
    print(e)
# Exceptions.exceptions type checking example

from mypy_boto3_logs.client import Exceptions

def handle_error(exc: Exceptions.AccessDeniedException) -> None:
    ...

Methods#

associate_kms_key#

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

Type annotations and code completion for boto3.client("logs").associate_kms_key method. boto3 documentation

# associate_kms_key method definition

def associate_kms_key(
    self,
    *,
    kmsKeyId: str,
    logGroupName: str = ...,
    resourceIdentifier: str = ...,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
# associate_kms_key method usage example with argument unpacking

kwargs: AssociateKmsKeyRequestRequestTypeDef = {  # (1)
    "kmsKeyId": ...,
}

parent.associate_kms_key(**kwargs)
  1. See AssociateKmsKeyRequestRequestTypeDef

can_paginate#

Check if an operation can be paginated.

Type annotations and code completion for boto3.client("logs").can_paginate method. boto3 documentation

# can_paginate method definition

def can_paginate(
    self,
    operation_name: str,
) -> bool:
    ...

cancel_export_task#

Cancels the specified export task.

Type annotations and code completion for boto3.client("logs").cancel_export_task method. boto3 documentation

# cancel_export_task method definition

def cancel_export_task(
    self,
    *,
    taskId: str,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
# cancel_export_task method usage example with argument unpacking

kwargs: CancelExportTaskRequestRequestTypeDef = {  # (1)
    "taskId": ...,
}

parent.cancel_export_task(**kwargs)
  1. See CancelExportTaskRequestRequestTypeDef

close#

Closes underlying endpoint connections.

Type annotations and code completion for boto3.client("logs").close method. boto3 documentation

# close method definition

def close(
    self,
) -> None:
    ...

create_delivery#

Creates a delivery.

Type annotations and code completion for boto3.client("logs").create_delivery method. boto3 documentation

# create_delivery method definition

def create_delivery(
    self,
    *,
    deliverySourceName: str,
    deliveryDestinationArn: str,
    recordFields: Sequence[str] = ...,
    fieldDelimiter: str = ...,
    s3DeliveryConfiguration: S3DeliveryConfigurationTypeDef = ...,  # (1)
    tags: Mapping[str, str] = ...,
) -> CreateDeliveryResponseTypeDef:  # (2)
    ...
  1. See S3DeliveryConfigurationTypeDef
  2. See CreateDeliveryResponseTypeDef
# create_delivery method usage example with argument unpacking

kwargs: CreateDeliveryRequestRequestTypeDef = {  # (1)
    "deliverySourceName": ...,
    "deliveryDestinationArn": ...,
}

parent.create_delivery(**kwargs)
  1. See CreateDeliveryRequestRequestTypeDef

create_export_task#

Creates an export task so that you can efficiently export data from a log group to an Amazon S3 bucket.

Type annotations and code completion for boto3.client("logs").create_export_task method. boto3 documentation

# create_export_task method definition

def create_export_task(
    self,
    *,
    logGroupName: str,
    fromTime: int,
    to: int,
    destination: str,
    taskName: str = ...,
    logStreamNamePrefix: str = ...,
    destinationPrefix: str = ...,
) -> CreateExportTaskResponseTypeDef:  # (1)
    ...
  1. See CreateExportTaskResponseTypeDef
# create_export_task method usage example with argument unpacking

kwargs: CreateExportTaskRequestRequestTypeDef = {  # (1)
    "logGroupName": ...,
    "fromTime": ...,
    "to": ...,
    "destination": ...,
}

parent.create_export_task(**kwargs)
  1. See CreateExportTaskRequestRequestTypeDef

create_log_anomaly_detector#

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

Type annotations and code completion for boto3.client("logs").create_log_anomaly_detector method. boto3 documentation

# create_log_anomaly_detector method definition

def create_log_anomaly_detector(
    self,
    *,
    logGroupArnList: Sequence[str],
    detectorName: str = ...,
    evaluationFrequency: EvaluationFrequencyType = ...,  # (1)
    filterPattern: str = ...,
    kmsKeyId: str = ...,
    anomalyVisibilityTime: int = ...,
    tags: Mapping[str, str] = ...,
) -> CreateLogAnomalyDetectorResponseTypeDef:  # (2)
    ...
  1. See EvaluationFrequencyType
  2. See CreateLogAnomalyDetectorResponseTypeDef
# create_log_anomaly_detector method usage example with argument unpacking

kwargs: CreateLogAnomalyDetectorRequestRequestTypeDef = {  # (1)
    "logGroupArnList": ...,
}

parent.create_log_anomaly_detector(**kwargs)
  1. See CreateLogAnomalyDetectorRequestRequestTypeDef

create_log_group#

Creates a log group with the specified name.

Type annotations and code completion for boto3.client("logs").create_log_group method. boto3 documentation

# create_log_group method definition

def create_log_group(
    self,
    *,
    logGroupName: str,
    kmsKeyId: str = ...,
    tags: Mapping[str, str] = ...,
    logGroupClass: LogGroupClassType = ...,  # (1)
) -> EmptyResponseMetadataTypeDef:  # (2)
    ...
  1. See LogGroupClassType
  2. See EmptyResponseMetadataTypeDef
# create_log_group method usage example with argument unpacking

kwargs: CreateLogGroupRequestRequestTypeDef = {  # (1)
    "logGroupName": ...,
}

parent.create_log_group(**kwargs)
  1. See CreateLogGroupRequestRequestTypeDef

create_log_stream#

Creates a log stream for the specified log group.

Type annotations and code completion for boto3.client("logs").create_log_stream method. boto3 documentation

# create_log_stream method definition

def create_log_stream(
    self,
    *,
    logGroupName: str,
    logStreamName: str,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
# create_log_stream method usage example with argument unpacking

kwargs: CreateLogStreamRequestRequestTypeDef = {  # (1)
    "logGroupName": ...,
    "logStreamName": ...,
}

parent.create_log_stream(**kwargs)
  1. See CreateLogStreamRequestRequestTypeDef

delete_account_policy#

Deletes a CloudWatch Logs account policy.

Type annotations and code completion for boto3.client("logs").delete_account_policy method. boto3 documentation

# delete_account_policy method definition

def delete_account_policy(
    self,
    *,
    policyName: str,
    policyType: PolicyTypeType,  # (1)
) -> EmptyResponseMetadataTypeDef:  # (2)
    ...
  1. See PolicyTypeType
  2. See EmptyResponseMetadataTypeDef
# delete_account_policy method usage example with argument unpacking

kwargs: DeleteAccountPolicyRequestRequestTypeDef = {  # (1)
    "policyName": ...,
    "policyType": ...,
}

parent.delete_account_policy(**kwargs)
  1. See DeleteAccountPolicyRequestRequestTypeDef

delete_data_protection_policy#

Deletes the data protection policy from the specified log group.

Type annotations and code completion for boto3.client("logs").delete_data_protection_policy method. boto3 documentation

# delete_data_protection_policy method definition

def delete_data_protection_policy(
    self,
    *,
    logGroupIdentifier: str,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
# delete_data_protection_policy method usage example with argument unpacking

kwargs: DeleteDataProtectionPolicyRequestRequestTypeDef = {  # (1)
    "logGroupIdentifier": ...,
}

parent.delete_data_protection_policy(**kwargs)
  1. See DeleteDataProtectionPolicyRequestRequestTypeDef

delete_delivery#

Deletes s delivery.

Type annotations and code completion for boto3.client("logs").delete_delivery method. boto3 documentation

# delete_delivery method definition

def delete_delivery(
    self,
    *,
    id: str,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
# delete_delivery method usage example with argument unpacking

kwargs: DeleteDeliveryRequestRequestTypeDef = {  # (1)
    "id": ...,
}

parent.delete_delivery(**kwargs)
  1. See DeleteDeliveryRequestRequestTypeDef

delete_delivery_destination#

Deletes a delivery destination.

Type annotations and code completion for boto3.client("logs").delete_delivery_destination method. boto3 documentation

# delete_delivery_destination method definition

def delete_delivery_destination(
    self,
    *,
    name: str,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
# delete_delivery_destination method usage example with argument unpacking

kwargs: DeleteDeliveryDestinationRequestRequestTypeDef = {  # (1)
    "name": ...,
}

parent.delete_delivery_destination(**kwargs)
  1. See DeleteDeliveryDestinationRequestRequestTypeDef

delete_delivery_destination_policy#

Deletes a delivery destination policy.

Type annotations and code completion for boto3.client("logs").delete_delivery_destination_policy method. boto3 documentation

# delete_delivery_destination_policy method definition

def delete_delivery_destination_policy(
    self,
    *,
    deliveryDestinationName: str,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
# delete_delivery_destination_policy method usage example with argument unpacking

kwargs: DeleteDeliveryDestinationPolicyRequestRequestTypeDef = {  # (1)
    "deliveryDestinationName": ...,
}

parent.delete_delivery_destination_policy(**kwargs)
  1. See DeleteDeliveryDestinationPolicyRequestRequestTypeDef

delete_delivery_source#

Deletes a delivery source.

Type annotations and code completion for boto3.client("logs").delete_delivery_source method. boto3 documentation

# delete_delivery_source method definition

def delete_delivery_source(
    self,
    *,
    name: str,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
# delete_delivery_source method usage example with argument unpacking

kwargs: DeleteDeliverySourceRequestRequestTypeDef = {  # (1)
    "name": ...,
}

parent.delete_delivery_source(**kwargs)
  1. See DeleteDeliverySourceRequestRequestTypeDef

delete_destination#

Deletes the specified destination, and eventually disables all the subscription filters that publish to it.

Type annotations and code completion for boto3.client("logs").delete_destination method. boto3 documentation

# delete_destination method definition

def delete_destination(
    self,
    *,
    destinationName: str,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
# delete_destination method usage example with argument unpacking

kwargs: DeleteDestinationRequestRequestTypeDef = {  # (1)
    "destinationName": ...,
}

parent.delete_destination(**kwargs)
  1. See DeleteDestinationRequestRequestTypeDef

delete_log_anomaly_detector#

Deletes the specified CloudWatch Logs anomaly detector.

Type annotations and code completion for boto3.client("logs").delete_log_anomaly_detector method. boto3 documentation

# delete_log_anomaly_detector method definition

def delete_log_anomaly_detector(
    self,
    *,
    anomalyDetectorArn: str,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
# delete_log_anomaly_detector method usage example with argument unpacking

kwargs: DeleteLogAnomalyDetectorRequestRequestTypeDef = {  # (1)
    "anomalyDetectorArn": ...,
}

parent.delete_log_anomaly_detector(**kwargs)
  1. See DeleteLogAnomalyDetectorRequestRequestTypeDef

delete_log_group#

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

Type annotations and code completion for boto3.client("logs").delete_log_group method. boto3 documentation

# delete_log_group method definition

def delete_log_group(
    self,
    *,
    logGroupName: str,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
# delete_log_group method usage example with argument unpacking

kwargs: DeleteLogGroupRequestRequestTypeDef = {  # (1)
    "logGroupName": ...,
}

parent.delete_log_group(**kwargs)
  1. See DeleteLogGroupRequestRequestTypeDef

delete_log_stream#

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

Type annotations and code completion for boto3.client("logs").delete_log_stream method. boto3 documentation

# delete_log_stream method definition

def delete_log_stream(
    self,
    *,
    logGroupName: str,
    logStreamName: str,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
# delete_log_stream method usage example with argument unpacking

kwargs: DeleteLogStreamRequestRequestTypeDef = {  # (1)
    "logGroupName": ...,
    "logStreamName": ...,
}

parent.delete_log_stream(**kwargs)
  1. See DeleteLogStreamRequestRequestTypeDef

delete_metric_filter#

Deletes the specified metric filter.

Type annotations and code completion for boto3.client("logs").delete_metric_filter method. boto3 documentation

# delete_metric_filter method definition

def delete_metric_filter(
    self,
    *,
    logGroupName: str,
    filterName: str,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
# delete_metric_filter method usage example with argument unpacking

kwargs: DeleteMetricFilterRequestRequestTypeDef = {  # (1)
    "logGroupName": ...,
    "filterName": ...,
}

parent.delete_metric_filter(**kwargs)
  1. See DeleteMetricFilterRequestRequestTypeDef

delete_query_definition#

Deletes a saved CloudWatch Logs Insights query definition.

Type annotations and code completion for boto3.client("logs").delete_query_definition method. boto3 documentation

# delete_query_definition method definition

def delete_query_definition(
    self,
    *,
    queryDefinitionId: str,
) -> DeleteQueryDefinitionResponseTypeDef:  # (1)
    ...
  1. See DeleteQueryDefinitionResponseTypeDef
# delete_query_definition method usage example with argument unpacking

kwargs: DeleteQueryDefinitionRequestRequestTypeDef = {  # (1)
    "queryDefinitionId": ...,
}

parent.delete_query_definition(**kwargs)
  1. See DeleteQueryDefinitionRequestRequestTypeDef

delete_resource_policy#

Deletes a resource policy from this account.

Type annotations and code completion for boto3.client("logs").delete_resource_policy method. boto3 documentation

# delete_resource_policy method definition

def delete_resource_policy(
    self,
    *,
    policyName: str = ...,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
# delete_resource_policy method usage example with argument unpacking

kwargs: DeleteResourcePolicyRequestRequestTypeDef = {  # (1)
    "policyName": ...,
}

parent.delete_resource_policy(**kwargs)
  1. See DeleteResourcePolicyRequestRequestTypeDef

delete_retention_policy#

Deletes the specified retention policy.

Type annotations and code completion for boto3.client("logs").delete_retention_policy method. boto3 documentation

# delete_retention_policy method definition

def delete_retention_policy(
    self,
    *,
    logGroupName: str,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
# delete_retention_policy method usage example with argument unpacking

kwargs: DeleteRetentionPolicyRequestRequestTypeDef = {  # (1)
    "logGroupName": ...,
}

parent.delete_retention_policy(**kwargs)
  1. See DeleteRetentionPolicyRequestRequestTypeDef

delete_subscription_filter#

Deletes the specified subscription filter.

Type annotations and code completion for boto3.client("logs").delete_subscription_filter method. boto3 documentation

# delete_subscription_filter method definition

def delete_subscription_filter(
    self,
    *,
    logGroupName: str,
    filterName: str,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
# delete_subscription_filter method usage example with argument unpacking

kwargs: DeleteSubscriptionFilterRequestRequestTypeDef = {  # (1)
    "logGroupName": ...,
    "filterName": ...,
}

parent.delete_subscription_filter(**kwargs)
  1. See DeleteSubscriptionFilterRequestRequestTypeDef

describe_account_policies#

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

Type annotations and code completion for boto3.client("logs").describe_account_policies method. boto3 documentation

# describe_account_policies method definition

def describe_account_policies(
    self,
    *,
    policyType: PolicyTypeType,  # (1)
    policyName: str = ...,
    accountIdentifiers: Sequence[str] = ...,
) -> DescribeAccountPoliciesResponseTypeDef:  # (2)
    ...
  1. See PolicyTypeType
  2. See DescribeAccountPoliciesResponseTypeDef
# describe_account_policies method usage example with argument unpacking

kwargs: DescribeAccountPoliciesRequestRequestTypeDef = {  # (1)
    "policyType": ...,
}

parent.describe_account_policies(**kwargs)
  1. See DescribeAccountPoliciesRequestRequestTypeDef

describe_configuration_templates#

Use this operation to return the valid and default values that are used when creating delivery sources, delivery destinations, and deliveries.

Type annotations and code completion for boto3.client("logs").describe_configuration_templates method. boto3 documentation

# describe_configuration_templates method definition

def describe_configuration_templates(
    self,
    *,
    service: str = ...,
    logTypes: Sequence[str] = ...,
    resourceTypes: Sequence[str] = ...,
    deliveryDestinationTypes: Sequence[DeliveryDestinationTypeType] = ...,  # (1)
    nextToken: str = ...,
    limit: int = ...,
) -> DescribeConfigurationTemplatesResponseTypeDef:  # (2)
    ...
  1. See DeliveryDestinationTypeType
  2. See DescribeConfigurationTemplatesResponseTypeDef
# describe_configuration_templates method usage example with argument unpacking

kwargs: DescribeConfigurationTemplatesRequestRequestTypeDef = {  # (1)
    "service": ...,
}

parent.describe_configuration_templates(**kwargs)
  1. See DescribeConfigurationTemplatesRequestRequestTypeDef

describe_deliveries#

Retrieves a list of the deliveries that have been created in the account.

Type annotations and code completion for boto3.client("logs").describe_deliveries method. boto3 documentation

# describe_deliveries method definition

def describe_deliveries(
    self,
    *,
    nextToken: str = ...,
    limit: int = ...,
) -> DescribeDeliveriesResponseTypeDef:  # (1)
    ...
  1. See DescribeDeliveriesResponseTypeDef
# describe_deliveries method usage example with argument unpacking

kwargs: DescribeDeliveriesRequestRequestTypeDef = {  # (1)
    "nextToken": ...,
}

parent.describe_deliveries(**kwargs)
  1. See DescribeDeliveriesRequestRequestTypeDef

describe_delivery_destinations#

Retrieves a list of the delivery destinations that have been created in the account.

Type annotations and code completion for boto3.client("logs").describe_delivery_destinations method. boto3 documentation

# describe_delivery_destinations method definition

def describe_delivery_destinations(
    self,
    *,
    nextToken: str = ...,
    limit: int = ...,
) -> DescribeDeliveryDestinationsResponseTypeDef:  # (1)
    ...
  1. See DescribeDeliveryDestinationsResponseTypeDef
# describe_delivery_destinations method usage example with argument unpacking

kwargs: DescribeDeliveryDestinationsRequestRequestTypeDef = {  # (1)
    "nextToken": ...,
}

parent.describe_delivery_destinations(**kwargs)
  1. See DescribeDeliveryDestinationsRequestRequestTypeDef

describe_delivery_sources#

Retrieves a list of the delivery sources that have been created in the account.

Type annotations and code completion for boto3.client("logs").describe_delivery_sources method. boto3 documentation

# describe_delivery_sources method definition

def describe_delivery_sources(
    self,
    *,
    nextToken: str = ...,
    limit: int = ...,
) -> DescribeDeliverySourcesResponseTypeDef:  # (1)
    ...
  1. See DescribeDeliverySourcesResponseTypeDef
# describe_delivery_sources method usage example with argument unpacking

kwargs: DescribeDeliverySourcesRequestRequestTypeDef = {  # (1)
    "nextToken": ...,
}

parent.describe_delivery_sources(**kwargs)
  1. See DescribeDeliverySourcesRequestRequestTypeDef

describe_destinations#

Lists all your destinations.

Type annotations and code completion for boto3.client("logs").describe_destinations method. boto3 documentation

# describe_destinations method definition

def describe_destinations(
    self,
    *,
    DestinationNamePrefix: str = ...,
    nextToken: str = ...,
    limit: int = ...,
) -> DescribeDestinationsResponseTypeDef:  # (1)
    ...
  1. See DescribeDestinationsResponseTypeDef
# describe_destinations method usage example with argument unpacking

kwargs: DescribeDestinationsRequestRequestTypeDef = {  # (1)
    "DestinationNamePrefix": ...,
}

parent.describe_destinations(**kwargs)
  1. See DescribeDestinationsRequestRequestTypeDef

describe_export_tasks#

Lists the specified export tasks.

Type annotations and code completion for boto3.client("logs").describe_export_tasks method. boto3 documentation

# describe_export_tasks method definition

def describe_export_tasks(
    self,
    *,
    taskId: str = ...,
    statusCode: ExportTaskStatusCodeType = ...,  # (1)
    nextToken: str = ...,
    limit: int = ...,
) -> DescribeExportTasksResponseTypeDef:  # (2)
    ...
  1. See ExportTaskStatusCodeType
  2. See DescribeExportTasksResponseTypeDef
# describe_export_tasks method usage example with argument unpacking

kwargs: DescribeExportTasksRequestRequestTypeDef = {  # (1)
    "taskId": ...,
}

parent.describe_export_tasks(**kwargs)
  1. See DescribeExportTasksRequestRequestTypeDef

describe_log_groups#

Lists the specified log groups.

Type annotations and code completion for boto3.client("logs").describe_log_groups method. boto3 documentation

# describe_log_groups method definition

def describe_log_groups(
    self,
    *,
    accountIdentifiers: Sequence[str] = ...,
    logGroupNamePrefix: str = ...,
    logGroupNamePattern: str = ...,
    nextToken: str = ...,
    limit: int = ...,
    includeLinkedAccounts: bool = ...,
    logGroupClass: LogGroupClassType = ...,  # (1)
) -> DescribeLogGroupsResponseTypeDef:  # (2)
    ...
  1. See LogGroupClassType
  2. See DescribeLogGroupsResponseTypeDef
# describe_log_groups method usage example with argument unpacking

kwargs: DescribeLogGroupsRequestRequestTypeDef = {  # (1)
    "accountIdentifiers": ...,
}

parent.describe_log_groups(**kwargs)
  1. See DescribeLogGroupsRequestRequestTypeDef

describe_log_streams#

Lists the log streams for the specified log group.

Type annotations and code completion for boto3.client("logs").describe_log_streams method. boto3 documentation

# describe_log_streams method definition

def describe_log_streams(
    self,
    *,
    logGroupName: str = ...,
    logGroupIdentifier: str = ...,
    logStreamNamePrefix: str = ...,
    orderBy: OrderByType = ...,  # (1)
    descending: bool = ...,
    nextToken: str = ...,
    limit: int = ...,
) -> DescribeLogStreamsResponseTypeDef:  # (2)
    ...
  1. See OrderByType
  2. See DescribeLogStreamsResponseTypeDef
# describe_log_streams method usage example with argument unpacking

kwargs: DescribeLogStreamsRequestRequestTypeDef = {  # (1)
    "logGroupName": ...,
}

parent.describe_log_streams(**kwargs)
  1. See DescribeLogStreamsRequestRequestTypeDef

describe_metric_filters#

Lists the specified metric filters.

Type annotations and code completion for boto3.client("logs").describe_metric_filters method. boto3 documentation

# describe_metric_filters method definition

def describe_metric_filters(
    self,
    *,
    logGroupName: str = ...,
    filterNamePrefix: str = ...,
    nextToken: str = ...,
    limit: int = ...,
    metricName: str = ...,
    metricNamespace: str = ...,
) -> DescribeMetricFiltersResponseTypeDef:  # (1)
    ...
  1. See DescribeMetricFiltersResponseTypeDef
# describe_metric_filters method usage example with argument unpacking

kwargs: DescribeMetricFiltersRequestRequestTypeDef = {  # (1)
    "logGroupName": ...,
}

parent.describe_metric_filters(**kwargs)
  1. See DescribeMetricFiltersRequestRequestTypeDef

describe_queries#

Returns a list of CloudWatch Logs Insights queries that are scheduled, running, or have been run recently in this account.

Type annotations and code completion for boto3.client("logs").describe_queries method. boto3 documentation

# describe_queries method definition

def describe_queries(
    self,
    *,
    logGroupName: str = ...,
    status: QueryStatusType = ...,  # (1)
    maxResults: int = ...,
    nextToken: str = ...,
) -> DescribeQueriesResponseTypeDef:  # (2)
    ...
  1. See QueryStatusType
  2. See DescribeQueriesResponseTypeDef
# describe_queries method usage example with argument unpacking

kwargs: DescribeQueriesRequestRequestTypeDef = {  # (1)
    "logGroupName": ...,
}

parent.describe_queries(**kwargs)
  1. See DescribeQueriesRequestRequestTypeDef

describe_query_definitions#

This operation returns a paginated list of your saved CloudWatch Logs Insights query definitions.

Type annotations and code completion for boto3.client("logs").describe_query_definitions method. boto3 documentation

# describe_query_definitions method definition

def describe_query_definitions(
    self,
    *,
    queryDefinitionNamePrefix: str = ...,
    maxResults: int = ...,
    nextToken: str = ...,
) -> DescribeQueryDefinitionsResponseTypeDef:  # (1)
    ...
  1. See DescribeQueryDefinitionsResponseTypeDef
# describe_query_definitions method usage example with argument unpacking

kwargs: DescribeQueryDefinitionsRequestRequestTypeDef = {  # (1)
    "queryDefinitionNamePrefix": ...,
}

parent.describe_query_definitions(**kwargs)
  1. See DescribeQueryDefinitionsRequestRequestTypeDef

describe_resource_policies#

Lists the resource policies in this account.

Type annotations and code completion for boto3.client("logs").describe_resource_policies method. boto3 documentation

# describe_resource_policies method definition

def describe_resource_policies(
    self,
    *,
    nextToken: str = ...,
    limit: int = ...,
) -> DescribeResourcePoliciesResponseTypeDef:  # (1)
    ...
  1. See DescribeResourcePoliciesResponseTypeDef
# describe_resource_policies method usage example with argument unpacking

kwargs: DescribeResourcePoliciesRequestRequestTypeDef = {  # (1)
    "nextToken": ...,
}

parent.describe_resource_policies(**kwargs)
  1. See DescribeResourcePoliciesRequestRequestTypeDef

describe_subscription_filters#

Lists the subscription filters for the specified log group.

Type annotations and code completion for boto3.client("logs").describe_subscription_filters method. boto3 documentation

# describe_subscription_filters method definition

def describe_subscription_filters(
    self,
    *,
    logGroupName: str,
    filterNamePrefix: str = ...,
    nextToken: str = ...,
    limit: int = ...,
) -> DescribeSubscriptionFiltersResponseTypeDef:  # (1)
    ...
  1. See DescribeSubscriptionFiltersResponseTypeDef
# describe_subscription_filters method usage example with argument unpacking

kwargs: DescribeSubscriptionFiltersRequestRequestTypeDef = {  # (1)
    "logGroupName": ...,
}

parent.describe_subscription_filters(**kwargs)
  1. See DescribeSubscriptionFiltersRequestRequestTypeDef

disassociate_kms_key#

Disassociates the specified KMS key from the specified log group or from all CloudWatch Logs Insights query results in the account.

Type annotations and code completion for boto3.client("logs").disassociate_kms_key method. boto3 documentation

# disassociate_kms_key method definition

def disassociate_kms_key(
    self,
    *,
    logGroupName: str = ...,
    resourceIdentifier: str = ...,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
# disassociate_kms_key method usage example with argument unpacking

kwargs: DisassociateKmsKeyRequestRequestTypeDef = {  # (1)
    "logGroupName": ...,
}

parent.disassociate_kms_key(**kwargs)
  1. See DisassociateKmsKeyRequestRequestTypeDef

filter_log_events#

Lists log events from the specified log group.

Type annotations and code completion for boto3.client("logs").filter_log_events method. boto3 documentation

# filter_log_events method definition

def filter_log_events(
    self,
    *,
    logGroupName: str = ...,
    logGroupIdentifier: str = ...,
    logStreamNames: Sequence[str] = ...,
    logStreamNamePrefix: str = ...,
    startTime: int = ...,
    endTime: int = ...,
    filterPattern: str = ...,
    nextToken: str = ...,
    limit: int = ...,
    interleaved: bool = ...,
    unmask: bool = ...,
) -> FilterLogEventsResponseTypeDef:  # (1)
    ...
  1. See FilterLogEventsResponseTypeDef
# filter_log_events method usage example with argument unpacking

kwargs: FilterLogEventsRequestRequestTypeDef = {  # (1)
    "logGroupName": ...,
}

parent.filter_log_events(**kwargs)
  1. See FilterLogEventsRequestRequestTypeDef

generate_presigned_url#

Generate a presigned url given a client, its method, and arguments.

Type annotations and code completion for boto3.client("logs").generate_presigned_url method. boto3 documentation

# generate_presigned_url method definition

def generate_presigned_url(
    self,
    ClientMethod: str,
    Params: Mapping[str, Any] = ...,
    ExpiresIn: int = 3600,
    HttpMethod: str = ...,
) -> str:
    ...

get_data_protection_policy#

Returns information about a log group data protection policy.

Type annotations and code completion for boto3.client("logs").get_data_protection_policy method. boto3 documentation

# get_data_protection_policy method definition

def get_data_protection_policy(
    self,
    *,
    logGroupIdentifier: str,
) -> GetDataProtectionPolicyResponseTypeDef:  # (1)
    ...
  1. See GetDataProtectionPolicyResponseTypeDef
# get_data_protection_policy method usage example with argument unpacking

kwargs: GetDataProtectionPolicyRequestRequestTypeDef = {  # (1)
    "logGroupIdentifier": ...,
}

parent.get_data_protection_policy(**kwargs)
  1. See GetDataProtectionPolicyRequestRequestTypeDef

get_delivery#

Returns complete information about one logical delivery.

Type annotations and code completion for boto3.client("logs").get_delivery method. boto3 documentation

# get_delivery method definition

def get_delivery(
    self,
    *,
    id: str,
) -> GetDeliveryResponseTypeDef:  # (1)
    ...
  1. See GetDeliveryResponseTypeDef
# get_delivery method usage example with argument unpacking

kwargs: GetDeliveryRequestRequestTypeDef = {  # (1)
    "id": ...,
}

parent.get_delivery(**kwargs)
  1. See GetDeliveryRequestRequestTypeDef

get_delivery_destination#

Retrieves complete information about one delivery destination.

Type annotations and code completion for boto3.client("logs").get_delivery_destination method. boto3 documentation

# get_delivery_destination method definition

def get_delivery_destination(
    self,
    *,
    name: str,
) -> GetDeliveryDestinationResponseTypeDef:  # (1)
    ...
  1. See GetDeliveryDestinationResponseTypeDef
# get_delivery_destination method usage example with argument unpacking

kwargs: GetDeliveryDestinationRequestRequestTypeDef = {  # (1)
    "name": ...,
}

parent.get_delivery_destination(**kwargs)
  1. See GetDeliveryDestinationRequestRequestTypeDef

get_delivery_destination_policy#

Retrieves the delivery destination policy assigned to the delivery destination that you specify.

Type annotations and code completion for boto3.client("logs").get_delivery_destination_policy method. boto3 documentation

# get_delivery_destination_policy method definition

def get_delivery_destination_policy(
    self,
    *,
    deliveryDestinationName: str,
) -> GetDeliveryDestinationPolicyResponseTypeDef:  # (1)
    ...
  1. See GetDeliveryDestinationPolicyResponseTypeDef
# get_delivery_destination_policy method usage example with argument unpacking

kwargs: GetDeliveryDestinationPolicyRequestRequestTypeDef = {  # (1)
    "deliveryDestinationName": ...,
}

parent.get_delivery_destination_policy(**kwargs)
  1. See GetDeliveryDestinationPolicyRequestRequestTypeDef

get_delivery_source#

Retrieves complete information about one delivery source.

Type annotations and code completion for boto3.client("logs").get_delivery_source method. boto3 documentation

# get_delivery_source method definition

def get_delivery_source(
    self,
    *,
    name: str,
) -> GetDeliverySourceResponseTypeDef:  # (1)
    ...
  1. See GetDeliverySourceResponseTypeDef
# get_delivery_source method usage example with argument unpacking

kwargs: GetDeliverySourceRequestRequestTypeDef = {  # (1)
    "name": ...,
}

parent.get_delivery_source(**kwargs)
  1. See GetDeliverySourceRequestRequestTypeDef

get_log_anomaly_detector#

Retrieves information about the log anomaly detector that you specify.

Type annotations and code completion for boto3.client("logs").get_log_anomaly_detector method. boto3 documentation

# get_log_anomaly_detector method definition

def get_log_anomaly_detector(
    self,
    *,
    anomalyDetectorArn: str,
) -> GetLogAnomalyDetectorResponseTypeDef:  # (1)
    ...
  1. See GetLogAnomalyDetectorResponseTypeDef
# get_log_anomaly_detector method usage example with argument unpacking

kwargs: GetLogAnomalyDetectorRequestRequestTypeDef = {  # (1)
    "anomalyDetectorArn": ...,
}

parent.get_log_anomaly_detector(**kwargs)
  1. See GetLogAnomalyDetectorRequestRequestTypeDef

get_log_events#

Lists log events from the specified log stream.

Type annotations and code completion for boto3.client("logs").get_log_events method. boto3 documentation

# get_log_events method definition

def get_log_events(
    self,
    *,
    logStreamName: str,
    logGroupName: str = ...,
    logGroupIdentifier: str = ...,
    startTime: int = ...,
    endTime: int = ...,
    nextToken: str = ...,
    limit: int = ...,
    startFromHead: bool = ...,
    unmask: bool = ...,
) -> GetLogEventsResponseTypeDef:  # (1)
    ...
  1. See GetLogEventsResponseTypeDef
# get_log_events method usage example with argument unpacking

kwargs: GetLogEventsRequestRequestTypeDef = {  # (1)
    "logStreamName": ...,
}

parent.get_log_events(**kwargs)
  1. See GetLogEventsRequestRequestTypeDef

get_log_group_fields#

Returns a list of the fields that are included in log events in the specified log group.

Type annotations and code completion for boto3.client("logs").get_log_group_fields method. boto3 documentation

# get_log_group_fields method definition

def get_log_group_fields(
    self,
    *,
    logGroupName: str = ...,
    time: int = ...,
    logGroupIdentifier: str = ...,
) -> GetLogGroupFieldsResponseTypeDef:  # (1)
    ...
  1. See GetLogGroupFieldsResponseTypeDef
# get_log_group_fields method usage example with argument unpacking

kwargs: GetLogGroupFieldsRequestRequestTypeDef = {  # (1)
    "logGroupName": ...,
}

parent.get_log_group_fields(**kwargs)
  1. See GetLogGroupFieldsRequestRequestTypeDef

get_log_record#

Retrieves all of the fields and values of a single log event.

Type annotations and code completion for boto3.client("logs").get_log_record method. boto3 documentation

# get_log_record method definition

def get_log_record(
    self,
    *,
    logRecordPointer: str,
    unmask: bool = ...,
) -> GetLogRecordResponseTypeDef:  # (1)
    ...
  1. See GetLogRecordResponseTypeDef
# get_log_record method usage example with argument unpacking

kwargs: GetLogRecordRequestRequestTypeDef = {  # (1)
    "logRecordPointer": ...,
}

parent.get_log_record(**kwargs)
  1. See GetLogRecordRequestRequestTypeDef

get_query_results#

Returns the results from the specified query.

Type annotations and code completion for boto3.client("logs").get_query_results method. boto3 documentation

# get_query_results method definition

def get_query_results(
    self,
    *,
    queryId: str,
) -> GetQueryResultsResponseTypeDef:  # (1)
    ...
  1. See GetQueryResultsResponseTypeDef
# get_query_results method usage example with argument unpacking

kwargs: GetQueryResultsRequestRequestTypeDef = {  # (1)
    "queryId": ...,
}

parent.get_query_results(**kwargs)
  1. See GetQueryResultsRequestRequestTypeDef

list_anomalies#

Returns a list of anomalies that log anomaly detectors have found.

Type annotations and code completion for boto3.client("logs").list_anomalies method. boto3 documentation

# list_anomalies method definition

def list_anomalies(
    self,
    *,
    anomalyDetectorArn: str = ...,
    suppressionState: SuppressionStateType = ...,  # (1)
    limit: int = ...,
    nextToken: str = ...,
) -> ListAnomaliesResponseTypeDef:  # (2)
    ...
  1. See SuppressionStateType
  2. See ListAnomaliesResponseTypeDef
# list_anomalies method usage example with argument unpacking

kwargs: ListAnomaliesRequestRequestTypeDef = {  # (1)
    "anomalyDetectorArn": ...,
}

parent.list_anomalies(**kwargs)
  1. See ListAnomaliesRequestRequestTypeDef

list_log_anomaly_detectors#

Retrieves a list of the log anomaly detectors in the account.

Type annotations and code completion for boto3.client("logs").list_log_anomaly_detectors method. boto3 documentation

# list_log_anomaly_detectors method definition

def list_log_anomaly_detectors(
    self,
    *,
    filterLogGroupArn: str = ...,
    limit: int = ...,
    nextToken: str = ...,
) -> ListLogAnomalyDetectorsResponseTypeDef:  # (1)
    ...
  1. See ListLogAnomalyDetectorsResponseTypeDef
# list_log_anomaly_detectors method usage example with argument unpacking

kwargs: ListLogAnomalyDetectorsRequestRequestTypeDef = {  # (1)
    "filterLogGroupArn": ...,
}

parent.list_log_anomaly_detectors(**kwargs)
  1. See ListLogAnomalyDetectorsRequestRequestTypeDef

list_tags_for_resource#

Displays the tags associated with a CloudWatch Logs resource.

Type annotations and code completion for boto3.client("logs").list_tags_for_resource method. boto3 documentation

# list_tags_for_resource method definition

def list_tags_for_resource(
    self,
    *,
    resourceArn: str,
) -> ListTagsForResourceResponseTypeDef:  # (1)
    ...
  1. See ListTagsForResourceResponseTypeDef
# list_tags_for_resource method usage example with argument unpacking

kwargs: ListTagsForResourceRequestRequestTypeDef = {  # (1)
    "resourceArn": ...,
}

parent.list_tags_for_resource(**kwargs)
  1. See ListTagsForResourceRequestRequestTypeDef

list_tags_log_group#

.

Type annotations and code completion for boto3.client("logs").list_tags_log_group method. boto3 documentation

# list_tags_log_group method definition

def list_tags_log_group(
    self,
    *,
    logGroupName: str,
) -> ListTagsLogGroupResponseTypeDef:  # (1)
    ...
  1. See ListTagsLogGroupResponseTypeDef
# list_tags_log_group method usage example with argument unpacking

kwargs: ListTagsLogGroupRequestRequestTypeDef = {  # (1)
    "logGroupName": ...,
}

parent.list_tags_log_group(**kwargs)
  1. See ListTagsLogGroupRequestRequestTypeDef

put_account_policy#

Creates an account-level data protection policy or subscription filter policy that applies to all log groups or a subset of log groups in the account.

Type annotations and code completion for boto3.client("logs").put_account_policy method. boto3 documentation

# put_account_policy method definition

def put_account_policy(
    self,
    *,
    policyName: str,
    policyDocument: str,
    policyType: PolicyTypeType,  # (1)
    scope: ScopeType = ...,  # (2)
    selectionCriteria: str = ...,
) -> PutAccountPolicyResponseTypeDef:  # (3)
    ...
  1. See PolicyTypeType
  2. See ScopeType
  3. See PutAccountPolicyResponseTypeDef
# put_account_policy method usage example with argument unpacking

kwargs: PutAccountPolicyRequestRequestTypeDef = {  # (1)
    "policyName": ...,
    "policyDocument": ...,
    "policyType": ...,
}

parent.put_account_policy(**kwargs)
  1. See PutAccountPolicyRequestRequestTypeDef

put_data_protection_policy#

Creates a data protection policy for the specified log group.

Type annotations and code completion for boto3.client("logs").put_data_protection_policy method. boto3 documentation

# put_data_protection_policy method definition

def put_data_protection_policy(
    self,
    *,
    logGroupIdentifier: str,
    policyDocument: str,
) -> PutDataProtectionPolicyResponseTypeDef:  # (1)
    ...
  1. See PutDataProtectionPolicyResponseTypeDef
# put_data_protection_policy method usage example with argument unpacking

kwargs: PutDataProtectionPolicyRequestRequestTypeDef = {  # (1)
    "logGroupIdentifier": ...,
    "policyDocument": ...,
}

parent.put_data_protection_policy(**kwargs)
  1. See PutDataProtectionPolicyRequestRequestTypeDef

put_delivery_destination#

Creates or updates a logical delivery destination.

Type annotations and code completion for boto3.client("logs").put_delivery_destination method. boto3 documentation

# put_delivery_destination method definition

def put_delivery_destination(
    self,
    *,
    name: str,
    deliveryDestinationConfiguration: DeliveryDestinationConfigurationTypeDef,  # (1)
    outputFormat: OutputFormatType = ...,  # (2)
    tags: Mapping[str, str] = ...,
) -> PutDeliveryDestinationResponseTypeDef:  # (3)
    ...
  1. See DeliveryDestinationConfigurationTypeDef
  2. See OutputFormatType
  3. See PutDeliveryDestinationResponseTypeDef
# put_delivery_destination method usage example with argument unpacking

kwargs: PutDeliveryDestinationRequestRequestTypeDef = {  # (1)
    "name": ...,
    "deliveryDestinationConfiguration": ...,
}

parent.put_delivery_destination(**kwargs)
  1. See PutDeliveryDestinationRequestRequestTypeDef

put_delivery_destination_policy#

Creates and assigns an IAM policy that grants permissions to CloudWatch Logs to deliver logs cross-account to a specified destination in this account.

Type annotations and code completion for boto3.client("logs").put_delivery_destination_policy method. boto3 documentation

# put_delivery_destination_policy method definition

def put_delivery_destination_policy(
    self,
    *,
    deliveryDestinationName: str,
    deliveryDestinationPolicy: str,
) -> PutDeliveryDestinationPolicyResponseTypeDef:  # (1)
    ...
  1. See PutDeliveryDestinationPolicyResponseTypeDef
# put_delivery_destination_policy method usage example with argument unpacking

kwargs: PutDeliveryDestinationPolicyRequestRequestTypeDef = {  # (1)
    "deliveryDestinationName": ...,
    "deliveryDestinationPolicy": ...,
}

parent.put_delivery_destination_policy(**kwargs)
  1. See PutDeliveryDestinationPolicyRequestRequestTypeDef

put_delivery_source#

Creates or updates a logical delivery source.

Type annotations and code completion for boto3.client("logs").put_delivery_source method. boto3 documentation

# put_delivery_source method definition

def put_delivery_source(
    self,
    *,
    name: str,
    resourceArn: str,
    logType: str,
    tags: Mapping[str, str] = ...,
) -> PutDeliverySourceResponseTypeDef:  # (1)
    ...
  1. See PutDeliverySourceResponseTypeDef
# put_delivery_source method usage example with argument unpacking

kwargs: PutDeliverySourceRequestRequestTypeDef = {  # (1)
    "name": ...,
    "resourceArn": ...,
    "logType": ...,
}

parent.put_delivery_source(**kwargs)
  1. See PutDeliverySourceRequestRequestTypeDef

put_destination#

Creates or updates a destination.

Type annotations and code completion for boto3.client("logs").put_destination method. boto3 documentation

# put_destination method definition

def put_destination(
    self,
    *,
    destinationName: str,
    targetArn: str,
    roleArn: str,
    tags: Mapping[str, str] = ...,
) -> PutDestinationResponseTypeDef:  # (1)
    ...
  1. See PutDestinationResponseTypeDef
# put_destination method usage example with argument unpacking

kwargs: PutDestinationRequestRequestTypeDef = {  # (1)
    "destinationName": ...,
    "targetArn": ...,
    "roleArn": ...,
}

parent.put_destination(**kwargs)
  1. See PutDestinationRequestRequestTypeDef

put_destination_policy#

Creates or updates an access policy associated with an existing destination.

Type annotations and code completion for boto3.client("logs").put_destination_policy method. boto3 documentation

# put_destination_policy method definition

def put_destination_policy(
    self,
    *,
    destinationName: str,
    accessPolicy: str,
    forceUpdate: bool = ...,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
# put_destination_policy method usage example with argument unpacking

kwargs: PutDestinationPolicyRequestRequestTypeDef = {  # (1)
    "destinationName": ...,
    "accessPolicy": ...,
}

parent.put_destination_policy(**kwargs)
  1. See PutDestinationPolicyRequestRequestTypeDef

put_log_events#

Uploads a batch of log events to the specified log stream.

Type annotations and code completion for boto3.client("logs").put_log_events method. boto3 documentation

# put_log_events method definition

def put_log_events(
    self,
    *,
    logGroupName: str,
    logStreamName: str,
    logEvents: Sequence[InputLogEventTypeDef],  # (1)
    sequenceToken: str = ...,
    entity: EntityTypeDef = ...,  # (2)
) -> PutLogEventsResponseTypeDef:  # (3)
    ...
  1. See InputLogEventTypeDef
  2. See EntityTypeDef
  3. See PutLogEventsResponseTypeDef
# put_log_events method usage example with argument unpacking

kwargs: PutLogEventsRequestRequestTypeDef = {  # (1)
    "logGroupName": ...,
    "logStreamName": ...,
    "logEvents": ...,
}

parent.put_log_events(**kwargs)
  1. See PutLogEventsRequestRequestTypeDef

put_metric_filter#

Creates or updates a metric filter and associates it with the specified log group.

Type annotations and code completion for boto3.client("logs").put_metric_filter method. boto3 documentation

# put_metric_filter method definition

def put_metric_filter(
    self,
    *,
    logGroupName: str,
    filterName: str,
    filterPattern: str,
    metricTransformations: Sequence[MetricTransformationUnionTypeDef],  # (1)
) -> EmptyResponseMetadataTypeDef:  # (2)
    ...
  1. See MetricTransformationTypeDef MetricTransformationOutputTypeDef
  2. See EmptyResponseMetadataTypeDef
# put_metric_filter method usage example with argument unpacking

kwargs: PutMetricFilterRequestRequestTypeDef = {  # (1)
    "logGroupName": ...,
    "filterName": ...,
    "filterPattern": ...,
    "metricTransformations": ...,
}

parent.put_metric_filter(**kwargs)
  1. See PutMetricFilterRequestRequestTypeDef

put_query_definition#

Creates or updates a query definition for CloudWatch Logs Insights.

Type annotations and code completion for boto3.client("logs").put_query_definition method. boto3 documentation

# put_query_definition method definition

def put_query_definition(
    self,
    *,
    name: str,
    queryString: str,
    queryDefinitionId: str = ...,
    logGroupNames: Sequence[str] = ...,
    clientToken: str = ...,
) -> PutQueryDefinitionResponseTypeDef:  # (1)
    ...
  1. See PutQueryDefinitionResponseTypeDef
# put_query_definition method usage example with argument unpacking

kwargs: PutQueryDefinitionRequestRequestTypeDef = {  # (1)
    "name": ...,
    "queryString": ...,
}

parent.put_query_definition(**kwargs)
  1. See PutQueryDefinitionRequestRequestTypeDef

put_resource_policy#

Creates or updates a resource policy allowing other Amazon Web Services services to put log events to this account, such as Amazon Route 53.

Type annotations and code completion for boto3.client("logs").put_resource_policy method. boto3 documentation

# put_resource_policy method definition

def put_resource_policy(
    self,
    *,
    policyName: str = ...,
    policyDocument: str = ...,
) -> PutResourcePolicyResponseTypeDef:  # (1)
    ...
  1. See PutResourcePolicyResponseTypeDef
# put_resource_policy method usage example with argument unpacking

kwargs: PutResourcePolicyRequestRequestTypeDef = {  # (1)
    "policyName": ...,
}

parent.put_resource_policy(**kwargs)
  1. See PutResourcePolicyRequestRequestTypeDef

put_retention_policy#

Sets the retention of the specified log group.

Type annotations and code completion for boto3.client("logs").put_retention_policy method. boto3 documentation

# put_retention_policy method definition

def put_retention_policy(
    self,
    *,
    logGroupName: str,
    retentionInDays: int,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
# put_retention_policy method usage example with argument unpacking

kwargs: PutRetentionPolicyRequestRequestTypeDef = {  # (1)
    "logGroupName": ...,
    "retentionInDays": ...,
}

parent.put_retention_policy(**kwargs)
  1. See PutRetentionPolicyRequestRequestTypeDef

put_subscription_filter#

Creates or updates a subscription filter and associates it with the specified log group.

Type annotations and code completion for boto3.client("logs").put_subscription_filter method. boto3 documentation

# put_subscription_filter method definition

def put_subscription_filter(
    self,
    *,
    logGroupName: str,
    filterName: str,
    filterPattern: str,
    destinationArn: str,
    roleArn: str = ...,
    distribution: DistributionType = ...,  # (1)
) -> EmptyResponseMetadataTypeDef:  # (2)
    ...
  1. See DistributionType
  2. See EmptyResponseMetadataTypeDef
# put_subscription_filter method usage example with argument unpacking

kwargs: PutSubscriptionFilterRequestRequestTypeDef = {  # (1)
    "logGroupName": ...,
    "filterName": ...,
    "filterPattern": ...,
    "destinationArn": ...,
}

parent.put_subscription_filter(**kwargs)
  1. See PutSubscriptionFilterRequestRequestTypeDef

start_live_tail#

Starts a Live Tail streaming session for one or more log groups.

Type annotations and code completion for boto3.client("logs").start_live_tail method. boto3 documentation

# start_live_tail method definition

def start_live_tail(
    self,
    *,
    logGroupIdentifiers: Sequence[str],
    logStreamNames: Sequence[str] = ...,
    logStreamNamePrefixes: Sequence[str] = ...,
    logEventFilterPattern: str = ...,
) -> StartLiveTailResponseTypeDef:  # (1)
    ...
  1. See StartLiveTailResponseTypeDef
# start_live_tail method usage example with argument unpacking

kwargs: StartLiveTailRequestRequestTypeDef = {  # (1)
    "logGroupIdentifiers": ...,
}

parent.start_live_tail(**kwargs)
  1. See StartLiveTailRequestRequestTypeDef

start_query#

Schedules a query of a log group using CloudWatch Logs Insights.

Type annotations and code completion for boto3.client("logs").start_query method. boto3 documentation

# start_query method definition

def start_query(
    self,
    *,
    startTime: int,
    endTime: int,
    queryString: str,
    logGroupName: str = ...,
    logGroupNames: Sequence[str] = ...,
    logGroupIdentifiers: Sequence[str] = ...,
    limit: int = ...,
) -> StartQueryResponseTypeDef:  # (1)
    ...
  1. See StartQueryResponseTypeDef
# start_query method usage example with argument unpacking

kwargs: StartQueryRequestRequestTypeDef = {  # (1)
    "startTime": ...,
    "endTime": ...,
    "queryString": ...,
}

parent.start_query(**kwargs)
  1. See StartQueryRequestRequestTypeDef

stop_query#

Stops a CloudWatch Logs Insights query that is in progress.

Type annotations and code completion for boto3.client("logs").stop_query method. boto3 documentation

# stop_query method definition

def stop_query(
    self,
    *,
    queryId: str,
) -> StopQueryResponseTypeDef:  # (1)
    ...
  1. See StopQueryResponseTypeDef
# stop_query method usage example with argument unpacking

kwargs: StopQueryRequestRequestTypeDef = {  # (1)
    "queryId": ...,
}

parent.stop_query(**kwargs)
  1. See StopQueryRequestRequestTypeDef

tag_log_group#

.

Type annotations and code completion for boto3.client("logs").tag_log_group method. boto3 documentation

# tag_log_group method definition

def tag_log_group(
    self,
    *,
    logGroupName: str,
    tags: Mapping[str, str],
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
# tag_log_group method usage example with argument unpacking

kwargs: TagLogGroupRequestRequestTypeDef = {  # (1)
    "logGroupName": ...,
    "tags": ...,
}

parent.tag_log_group(**kwargs)
  1. See TagLogGroupRequestRequestTypeDef

tag_resource#

Assigns one or more tags (key-value pairs) to the specified CloudWatch Logs resource.

Type annotations and code completion for boto3.client("logs").tag_resource method. boto3 documentation

# tag_resource method definition

def tag_resource(
    self,
    *,
    resourceArn: str,
    tags: Mapping[str, str],
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
# tag_resource method usage example with argument unpacking

kwargs: TagResourceRequestRequestTypeDef = {  # (1)
    "resourceArn": ...,
    "tags": ...,
}

parent.tag_resource(**kwargs)
  1. See TagResourceRequestRequestTypeDef

test_metric_filter#

Tests the filter pattern of a metric filter against a sample of log event messages.

Type annotations and code completion for boto3.client("logs").test_metric_filter method. boto3 documentation

# test_metric_filter method definition

def test_metric_filter(
    self,
    *,
    filterPattern: str,
    logEventMessages: Sequence[str],
) -> TestMetricFilterResponseTypeDef:  # (1)
    ...
  1. See TestMetricFilterResponseTypeDef
# test_metric_filter method usage example with argument unpacking

kwargs: TestMetricFilterRequestRequestTypeDef = {  # (1)
    "filterPattern": ...,
    "logEventMessages": ...,
}

parent.test_metric_filter(**kwargs)
  1. See TestMetricFilterRequestRequestTypeDef

untag_log_group#

.

Type annotations and code completion for boto3.client("logs").untag_log_group method. boto3 documentation

# untag_log_group method definition

def untag_log_group(
    self,
    *,
    logGroupName: str,
    tags: Sequence[str],
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
# untag_log_group method usage example with argument unpacking

kwargs: UntagLogGroupRequestRequestTypeDef = {  # (1)
    "logGroupName": ...,
    "tags": ...,
}

parent.untag_log_group(**kwargs)
  1. See UntagLogGroupRequestRequestTypeDef

untag_resource#

Removes one or more tags from the specified resource.

Type annotations and code completion for boto3.client("logs").untag_resource method. boto3 documentation

# untag_resource method definition

def untag_resource(
    self,
    *,
    resourceArn: str,
    tagKeys: Sequence[str],
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
# untag_resource method usage example with argument unpacking

kwargs: UntagResourceRequestRequestTypeDef = {  # (1)
    "resourceArn": ...,
    "tagKeys": ...,
}

parent.untag_resource(**kwargs)
  1. See UntagResourceRequestRequestTypeDef

update_anomaly#

Use this operation to suppress anomaly detection for a specified anomaly or pattern.

Type annotations and code completion for boto3.client("logs").update_anomaly method. boto3 documentation

# update_anomaly method definition

def update_anomaly(
    self,
    *,
    anomalyDetectorArn: str,
    anomalyId: str = ...,
    patternId: str = ...,
    suppressionType: SuppressionTypeType = ...,  # (1)
    suppressionPeriod: SuppressionPeriodTypeDef = ...,  # (2)
    baseline: bool = ...,
) -> EmptyResponseMetadataTypeDef:  # (3)
    ...
  1. See SuppressionTypeType
  2. See SuppressionPeriodTypeDef
  3. See EmptyResponseMetadataTypeDef
# update_anomaly method usage example with argument unpacking

kwargs: UpdateAnomalyRequestRequestTypeDef = {  # (1)
    "anomalyDetectorArn": ...,
}

parent.update_anomaly(**kwargs)
  1. See UpdateAnomalyRequestRequestTypeDef

update_delivery_configuration#

Use this operation to update the configuration of a delivery to change either the S3 path pattern or the format of the delivered logs.

Type annotations and code completion for boto3.client("logs").update_delivery_configuration method. boto3 documentation

# update_delivery_configuration method definition

def update_delivery_configuration(
    self,
    *,
    id: str,
    recordFields: Sequence[str] = ...,
    fieldDelimiter: str = ...,
    s3DeliveryConfiguration: S3DeliveryConfigurationTypeDef = ...,  # (1)
) -> Dict[str, Any]:
    ...
  1. See S3DeliveryConfigurationTypeDef
# update_delivery_configuration method usage example with argument unpacking

kwargs: UpdateDeliveryConfigurationRequestRequestTypeDef = {  # (1)
    "id": ...,
}

parent.update_delivery_configuration(**kwargs)
  1. See UpdateDeliveryConfigurationRequestRequestTypeDef

update_log_anomaly_detector#

Updates an existing log anomaly detector.

Type annotations and code completion for boto3.client("logs").update_log_anomaly_detector method. boto3 documentation

# update_log_anomaly_detector method definition

def update_log_anomaly_detector(
    self,
    *,
    anomalyDetectorArn: str,
    enabled: bool,
    evaluationFrequency: EvaluationFrequencyType = ...,  # (1)
    filterPattern: str = ...,
    anomalyVisibilityTime: int = ...,
) -> EmptyResponseMetadataTypeDef:  # (2)
    ...
  1. See EvaluationFrequencyType
  2. See EmptyResponseMetadataTypeDef
# update_log_anomaly_detector method usage example with argument unpacking

kwargs: UpdateLogAnomalyDetectorRequestRequestTypeDef = {  # (1)
    "anomalyDetectorArn": ...,
    "enabled": ...,
}

parent.update_log_anomaly_detector(**kwargs)
  1. See UpdateLogAnomalyDetectorRequestRequestTypeDef

get_paginator#

Type annotations and code completion for boto3.client("logs").get_paginator method with overloads.