Interface CloudWatchLogsClient
- All Superinterfaces:
AutoCloseable,AwsClient,SdkAutoCloseable,SdkClient
builder() method.
You can use Amazon CloudWatch Logs to monitor, store, and access your log files from EC2 instances, CloudTrail, and other sources. You can then retrieve the associated log data from CloudWatch Logs using the CloudWatch console. Alternatively, you can use CloudWatch Logs commands in the Amazon Web Services CLI, CloudWatch Logs API, or CloudWatch Logs SDK.
You can use CloudWatch Logs to:
-
Monitor logs from EC2 instances in real time: You can use CloudWatch Logs to monitor applications and systems using log data. For example, CloudWatch Logs can track the number of errors that occur in your application logs. Then, it can send you a notification whenever the rate of errors exceeds a threshold that you specify. CloudWatch Logs uses your log data for monitoring so no code changes are required. For example, you can monitor application logs for specific literal terms (such as "NullReferenceException"). You can also count the number of occurrences of a literal term at a particular position in log data (such as "404" status codes in an Apache access log). When the term you are searching for is found, CloudWatch Logs reports the data to a CloudWatch metric that you specify.
-
Monitor CloudTrail logged events: You can create alarms in CloudWatch and receive notifications of particular API activity as captured by CloudTrail. You can use the notification to perform troubleshooting.
-
Archive log data: You can use CloudWatch Logs to store your log data in highly durable storage. You can change the log retention setting so that any log events earlier than this setting are automatically deleted. The CloudWatch Logs agent helps to quickly send both rotated and non-rotated log data off of a host and into the log service. You can then access the raw log data when you need it.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringValue for looking up the service's metadata from theServiceMetadataProvider.static final String -
Method Summary
Modifier and TypeMethodDescriptiondefault AssociateKmsKeyResponseassociateKmsKey(Consumer<AssociateKmsKeyRequest.Builder> associateKmsKeyRequest) 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.default AssociateKmsKeyResponseassociateKmsKey(AssociateKmsKeyRequest associateKmsKeyRequest) 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.static CloudWatchLogsClientBuilderbuilder()Create a builder that can be used to configure and create aCloudWatchLogsClient.default CancelExportTaskResponsecancelExportTask(Consumer<CancelExportTaskRequest.Builder> cancelExportTaskRequest) Cancels the specified export task.default CancelExportTaskResponsecancelExportTask(CancelExportTaskRequest cancelExportTaskRequest) Cancels the specified export task.static CloudWatchLogsClientcreate()Create aCloudWatchLogsClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider.default CreateDeliveryResponsecreateDelivery(Consumer<CreateDeliveryRequest.Builder> createDeliveryRequest) Creates a delivery.default CreateDeliveryResponsecreateDelivery(CreateDeliveryRequest createDeliveryRequest) Creates a delivery.default CreateExportTaskResponsecreateExportTask(Consumer<CreateExportTaskRequest.Builder> createExportTaskRequest) Creates an export task so that you can efficiently export data from a log group to an Amazon S3 bucket.default CreateExportTaskResponsecreateExportTask(CreateExportTaskRequest createExportTaskRequest) Creates an export task so that you can efficiently export data from a log group to an Amazon S3 bucket.default CreateLogAnomalyDetectorResponsecreateLogAnomalyDetector(Consumer<CreateLogAnomalyDetectorRequest.Builder> createLogAnomalyDetectorRequest) Creates an anomaly detector that regularly scans one or more log groups and look for patterns and anomalies in the logs.default CreateLogAnomalyDetectorResponsecreateLogAnomalyDetector(CreateLogAnomalyDetectorRequest createLogAnomalyDetectorRequest) Creates an anomaly detector that regularly scans one or more log groups and look for patterns and anomalies in the logs.default CreateLogGroupResponsecreateLogGroup(Consumer<CreateLogGroupRequest.Builder> createLogGroupRequest) Creates a log group with the specified name.default CreateLogGroupResponsecreateLogGroup(CreateLogGroupRequest createLogGroupRequest) Creates a log group with the specified name.default CreateLogStreamResponsecreateLogStream(Consumer<CreateLogStreamRequest.Builder> createLogStreamRequest) Creates a log stream for the specified log group.default CreateLogStreamResponsecreateLogStream(CreateLogStreamRequest createLogStreamRequest) Creates a log stream for the specified log group.default DeleteAccountPolicyResponsedeleteAccountPolicy(Consumer<DeleteAccountPolicyRequest.Builder> deleteAccountPolicyRequest) Deletes a CloudWatch Logs account policy.default DeleteAccountPolicyResponsedeleteAccountPolicy(DeleteAccountPolicyRequest deleteAccountPolicyRequest) Deletes a CloudWatch Logs account policy.deleteDataProtectionPolicy(Consumer<DeleteDataProtectionPolicyRequest.Builder> deleteDataProtectionPolicyRequest) Deletes the data protection policy from the specified log group.deleteDataProtectionPolicy(DeleteDataProtectionPolicyRequest deleteDataProtectionPolicyRequest) Deletes the data protection policy from the specified log group.default DeleteDeliveryResponsedeleteDelivery(Consumer<DeleteDeliveryRequest.Builder> deleteDeliveryRequest) Deletes s delivery.default DeleteDeliveryResponsedeleteDelivery(DeleteDeliveryRequest deleteDeliveryRequest) Deletes s delivery.deleteDeliveryDestination(Consumer<DeleteDeliveryDestinationRequest.Builder> deleteDeliveryDestinationRequest) Deletes a delivery destination.deleteDeliveryDestination(DeleteDeliveryDestinationRequest deleteDeliveryDestinationRequest) Deletes a delivery destination.deleteDeliveryDestinationPolicy(Consumer<DeleteDeliveryDestinationPolicyRequest.Builder> deleteDeliveryDestinationPolicyRequest) Deletes a delivery destination policy.deleteDeliveryDestinationPolicy(DeleteDeliveryDestinationPolicyRequest deleteDeliveryDestinationPolicyRequest) Deletes a delivery destination policy.default DeleteDeliverySourceResponsedeleteDeliverySource(Consumer<DeleteDeliverySourceRequest.Builder> deleteDeliverySourceRequest) Deletes a delivery source.default DeleteDeliverySourceResponsedeleteDeliverySource(DeleteDeliverySourceRequest deleteDeliverySourceRequest) Deletes a delivery source.default DeleteDestinationResponsedeleteDestination(Consumer<DeleteDestinationRequest.Builder> deleteDestinationRequest) Deletes the specified destination, and eventually disables all the subscription filters that publish to it.default DeleteDestinationResponsedeleteDestination(DeleteDestinationRequest deleteDestinationRequest) Deletes the specified destination, and eventually disables all the subscription filters that publish to it.default DeleteLogAnomalyDetectorResponsedeleteLogAnomalyDetector(Consumer<DeleteLogAnomalyDetectorRequest.Builder> deleteLogAnomalyDetectorRequest) Deletes the specified CloudWatch Logs anomaly detector.default DeleteLogAnomalyDetectorResponsedeleteLogAnomalyDetector(DeleteLogAnomalyDetectorRequest deleteLogAnomalyDetectorRequest) Deletes the specified CloudWatch Logs anomaly detector.default DeleteLogGroupResponsedeleteLogGroup(Consumer<DeleteLogGroupRequest.Builder> deleteLogGroupRequest) Deletes the specified log group and permanently deletes all the archived log events associated with the log group.default DeleteLogGroupResponsedeleteLogGroup(DeleteLogGroupRequest deleteLogGroupRequest) Deletes the specified log group and permanently deletes all the archived log events associated with the log group.default DeleteLogStreamResponsedeleteLogStream(Consumer<DeleteLogStreamRequest.Builder> deleteLogStreamRequest) Deletes the specified log stream and permanently deletes all the archived log events associated with the log stream.default DeleteLogStreamResponsedeleteLogStream(DeleteLogStreamRequest deleteLogStreamRequest) Deletes the specified log stream and permanently deletes all the archived log events associated with the log stream.default DeleteMetricFilterResponsedeleteMetricFilter(Consumer<DeleteMetricFilterRequest.Builder> deleteMetricFilterRequest) Deletes the specified metric filter.default DeleteMetricFilterResponsedeleteMetricFilter(DeleteMetricFilterRequest deleteMetricFilterRequest) Deletes the specified metric filter.default DeleteQueryDefinitionResponsedeleteQueryDefinition(Consumer<DeleteQueryDefinitionRequest.Builder> deleteQueryDefinitionRequest) Deletes a saved CloudWatch Logs Insights query definition.default DeleteQueryDefinitionResponsedeleteQueryDefinition(DeleteQueryDefinitionRequest deleteQueryDefinitionRequest) Deletes a saved CloudWatch Logs Insights query definition.default DeleteResourcePolicyResponsedeleteResourcePolicy(Consumer<DeleteResourcePolicyRequest.Builder> deleteResourcePolicyRequest) Deletes a resource policy from this account.default DeleteResourcePolicyResponsedeleteResourcePolicy(DeleteResourcePolicyRequest deleteResourcePolicyRequest) Deletes a resource policy from this account.default DeleteRetentionPolicyResponsedeleteRetentionPolicy(Consumer<DeleteRetentionPolicyRequest.Builder> deleteRetentionPolicyRequest) Deletes the specified retention policy.default DeleteRetentionPolicyResponsedeleteRetentionPolicy(DeleteRetentionPolicyRequest deleteRetentionPolicyRequest) Deletes the specified retention policy.default DeleteSubscriptionFilterResponsedeleteSubscriptionFilter(Consumer<DeleteSubscriptionFilterRequest.Builder> deleteSubscriptionFilterRequest) Deletes the specified subscription filter.default DeleteSubscriptionFilterResponsedeleteSubscriptionFilter(DeleteSubscriptionFilterRequest deleteSubscriptionFilterRequest) Deletes the specified subscription filter.default DescribeAccountPoliciesResponsedescribeAccountPolicies(Consumer<DescribeAccountPoliciesRequest.Builder> describeAccountPoliciesRequest) Returns a list of all CloudWatch Logs account policies in the account.default DescribeAccountPoliciesResponsedescribeAccountPolicies(DescribeAccountPoliciesRequest describeAccountPoliciesRequest) Returns a list of all CloudWatch Logs account policies in the account.describeConfigurationTemplates(Consumer<DescribeConfigurationTemplatesRequest.Builder> describeConfigurationTemplatesRequest) Use this operation to return the valid and default values that are used when creating delivery sources, delivery destinations, and deliveries.describeConfigurationTemplates(DescribeConfigurationTemplatesRequest describeConfigurationTemplatesRequest) Use this operation to return the valid and default values that are used when creating delivery sources, delivery destinations, and deliveries.describeConfigurationTemplatesPaginator(Consumer<DescribeConfigurationTemplatesRequest.Builder> describeConfigurationTemplatesRequest) This is a variant ofdescribeConfigurationTemplates(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeConfigurationTemplatesRequest)operation.describeConfigurationTemplatesPaginator(DescribeConfigurationTemplatesRequest describeConfigurationTemplatesRequest) This is a variant ofdescribeConfigurationTemplates(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeConfigurationTemplatesRequest)operation.default DescribeDeliveriesResponsedescribeDeliveries(Consumer<DescribeDeliveriesRequest.Builder> describeDeliveriesRequest) Retrieves a list of the deliveries that have been created in the account.default DescribeDeliveriesResponsedescribeDeliveries(DescribeDeliveriesRequest describeDeliveriesRequest) Retrieves a list of the deliveries that have been created in the account.default DescribeDeliveriesIterabledescribeDeliveriesPaginator(Consumer<DescribeDeliveriesRequest.Builder> describeDeliveriesRequest) This is a variant ofdescribeDeliveries(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeDeliveriesRequest)operation.default DescribeDeliveriesIterabledescribeDeliveriesPaginator(DescribeDeliveriesRequest describeDeliveriesRequest) This is a variant ofdescribeDeliveries(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeDeliveriesRequest)operation.describeDeliveryDestinations(Consumer<DescribeDeliveryDestinationsRequest.Builder> describeDeliveryDestinationsRequest) Retrieves a list of the delivery destinations that have been created in the account.describeDeliveryDestinations(DescribeDeliveryDestinationsRequest describeDeliveryDestinationsRequest) Retrieves a list of the delivery destinations that have been created in the account.describeDeliveryDestinationsPaginator(Consumer<DescribeDeliveryDestinationsRequest.Builder> describeDeliveryDestinationsRequest) This is a variant ofdescribeDeliveryDestinations(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeDeliveryDestinationsRequest)operation.describeDeliveryDestinationsPaginator(DescribeDeliveryDestinationsRequest describeDeliveryDestinationsRequest) This is a variant ofdescribeDeliveryDestinations(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeDeliveryDestinationsRequest)operation.default DescribeDeliverySourcesResponsedescribeDeliverySources(Consumer<DescribeDeliverySourcesRequest.Builder> describeDeliverySourcesRequest) Retrieves a list of the delivery sources that have been created in the account.default DescribeDeliverySourcesResponsedescribeDeliverySources(DescribeDeliverySourcesRequest describeDeliverySourcesRequest) Retrieves a list of the delivery sources that have been created in the account.default DescribeDeliverySourcesIterabledescribeDeliverySourcesPaginator(Consumer<DescribeDeliverySourcesRequest.Builder> describeDeliverySourcesRequest) This is a variant ofdescribeDeliverySources(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeDeliverySourcesRequest)operation.default DescribeDeliverySourcesIterabledescribeDeliverySourcesPaginator(DescribeDeliverySourcesRequest describeDeliverySourcesRequest) This is a variant ofdescribeDeliverySources(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeDeliverySourcesRequest)operation.default DescribeDestinationsResponseLists all your destinations.default DescribeDestinationsResponsedescribeDestinations(Consumer<DescribeDestinationsRequest.Builder> describeDestinationsRequest) Lists all your destinations.default DescribeDestinationsResponsedescribeDestinations(DescribeDestinationsRequest describeDestinationsRequest) Lists all your destinations.default DescribeDestinationsIterableThis is a variant ofdescribeDestinations(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeDestinationsRequest)operation.default DescribeDestinationsIterabledescribeDestinationsPaginator(Consumer<DescribeDestinationsRequest.Builder> describeDestinationsRequest) This is a variant ofdescribeDestinations(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeDestinationsRequest)operation.default DescribeDestinationsIterabledescribeDestinationsPaginator(DescribeDestinationsRequest describeDestinationsRequest) This is a variant ofdescribeDestinations(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeDestinationsRequest)operation.default DescribeExportTasksResponseLists the specified export tasks.default DescribeExportTasksResponsedescribeExportTasks(Consumer<DescribeExportTasksRequest.Builder> describeExportTasksRequest) Lists the specified export tasks.default DescribeExportTasksResponsedescribeExportTasks(DescribeExportTasksRequest describeExportTasksRequest) Lists the specified export tasks.default DescribeLogGroupsResponseLists the specified log groups.default DescribeLogGroupsResponsedescribeLogGroups(Consumer<DescribeLogGroupsRequest.Builder> describeLogGroupsRequest) Lists the specified log groups.default DescribeLogGroupsResponsedescribeLogGroups(DescribeLogGroupsRequest describeLogGroupsRequest) Lists the specified log groups.default DescribeLogGroupsIterableThis is a variant ofdescribeLogGroups(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeLogGroupsRequest)operation.default DescribeLogGroupsIterabledescribeLogGroupsPaginator(Consumer<DescribeLogGroupsRequest.Builder> describeLogGroupsRequest) This is a variant ofdescribeLogGroups(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeLogGroupsRequest)operation.default DescribeLogGroupsIterabledescribeLogGroupsPaginator(DescribeLogGroupsRequest describeLogGroupsRequest) This is a variant ofdescribeLogGroups(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeLogGroupsRequest)operation.default DescribeLogStreamsResponsedescribeLogStreams(Consumer<DescribeLogStreamsRequest.Builder> describeLogStreamsRequest) Lists the log streams for the specified log group.default DescribeLogStreamsResponsedescribeLogStreams(DescribeLogStreamsRequest describeLogStreamsRequest) Lists the log streams for the specified log group.default DescribeLogStreamsIterabledescribeLogStreamsPaginator(Consumer<DescribeLogStreamsRequest.Builder> describeLogStreamsRequest) This is a variant ofdescribeLogStreams(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeLogStreamsRequest)operation.default DescribeLogStreamsIterabledescribeLogStreamsPaginator(DescribeLogStreamsRequest describeLogStreamsRequest) This is a variant ofdescribeLogStreams(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeLogStreamsRequest)operation.default DescribeMetricFiltersResponseLists the specified metric filters.default DescribeMetricFiltersResponsedescribeMetricFilters(Consumer<DescribeMetricFiltersRequest.Builder> describeMetricFiltersRequest) Lists the specified metric filters.default DescribeMetricFiltersResponsedescribeMetricFilters(DescribeMetricFiltersRequest describeMetricFiltersRequest) Lists the specified metric filters.default DescribeMetricFiltersIterableThis is a variant ofdescribeMetricFilters(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeMetricFiltersRequest)operation.default DescribeMetricFiltersIterabledescribeMetricFiltersPaginator(Consumer<DescribeMetricFiltersRequest.Builder> describeMetricFiltersRequest) This is a variant ofdescribeMetricFilters(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeMetricFiltersRequest)operation.default DescribeMetricFiltersIterabledescribeMetricFiltersPaginator(DescribeMetricFiltersRequest describeMetricFiltersRequest) This is a variant ofdescribeMetricFilters(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeMetricFiltersRequest)operation.default DescribeQueriesResponseReturns a list of CloudWatch Logs Insights queries that are scheduled, running, or have been run recently in this account.default DescribeQueriesResponsedescribeQueries(Consumer<DescribeQueriesRequest.Builder> describeQueriesRequest) Returns a list of CloudWatch Logs Insights queries that are scheduled, running, or have been run recently in this account.default DescribeQueriesResponsedescribeQueries(DescribeQueriesRequest describeQueriesRequest) Returns a list of CloudWatch Logs Insights queries that are scheduled, running, or have been run recently in this account.default DescribeQueryDefinitionsResponsedescribeQueryDefinitions(Consumer<DescribeQueryDefinitionsRequest.Builder> describeQueryDefinitionsRequest) This operation returns a paginated list of your saved CloudWatch Logs Insights query definitions.default DescribeQueryDefinitionsResponsedescribeQueryDefinitions(DescribeQueryDefinitionsRequest describeQueryDefinitionsRequest) This operation returns a paginated list of your saved CloudWatch Logs Insights query definitions.default DescribeResourcePoliciesResponseLists the resource policies in this account.default DescribeResourcePoliciesResponsedescribeResourcePolicies(Consumer<DescribeResourcePoliciesRequest.Builder> describeResourcePoliciesRequest) Lists the resource policies in this account.default DescribeResourcePoliciesResponsedescribeResourcePolicies(DescribeResourcePoliciesRequest describeResourcePoliciesRequest) Lists the resource policies in this account.describeSubscriptionFilters(Consumer<DescribeSubscriptionFiltersRequest.Builder> describeSubscriptionFiltersRequest) Lists the subscription filters for the specified log group.describeSubscriptionFilters(DescribeSubscriptionFiltersRequest describeSubscriptionFiltersRequest) Lists the subscription filters for the specified log group.describeSubscriptionFiltersPaginator(Consumer<DescribeSubscriptionFiltersRequest.Builder> describeSubscriptionFiltersRequest) This is a variant ofdescribeSubscriptionFilters(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeSubscriptionFiltersRequest)operation.describeSubscriptionFiltersPaginator(DescribeSubscriptionFiltersRequest describeSubscriptionFiltersRequest) This is a variant ofdescribeSubscriptionFilters(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeSubscriptionFiltersRequest)operation.default DisassociateKmsKeyResponsedisassociateKmsKey(Consumer<DisassociateKmsKeyRequest.Builder> disassociateKmsKeyRequest) Disassociates the specified KMS key from the specified log group or from all CloudWatch Logs Insights query results in the account.default DisassociateKmsKeyResponsedisassociateKmsKey(DisassociateKmsKeyRequest disassociateKmsKeyRequest) Disassociates the specified KMS key from the specified log group or from all CloudWatch Logs Insights query results in the account.default FilterLogEventsResponsefilterLogEvents(Consumer<FilterLogEventsRequest.Builder> filterLogEventsRequest) Lists log events from the specified log group.default FilterLogEventsResponsefilterLogEvents(FilterLogEventsRequest filterLogEventsRequest) Lists log events from the specified log group.default FilterLogEventsIterablefilterLogEventsPaginator(Consumer<FilterLogEventsRequest.Builder> filterLogEventsRequest) This is a variant offilterLogEvents(software.amazon.awssdk.services.cloudwatchlogs.model.FilterLogEventsRequest)operation.default FilterLogEventsIterablefilterLogEventsPaginator(FilterLogEventsRequest filterLogEventsRequest) This is a variant offilterLogEvents(software.amazon.awssdk.services.cloudwatchlogs.model.FilterLogEventsRequest)operation.default GetDataProtectionPolicyResponsegetDataProtectionPolicy(Consumer<GetDataProtectionPolicyRequest.Builder> getDataProtectionPolicyRequest) Returns information about a log group data protection policy.default GetDataProtectionPolicyResponsegetDataProtectionPolicy(GetDataProtectionPolicyRequest getDataProtectionPolicyRequest) Returns information about a log group data protection policy.default GetDeliveryResponsegetDelivery(Consumer<GetDeliveryRequest.Builder> getDeliveryRequest) Returns complete information about one logical delivery.default GetDeliveryResponsegetDelivery(GetDeliveryRequest getDeliveryRequest) Returns complete information about one logical delivery.default GetDeliveryDestinationResponsegetDeliveryDestination(Consumer<GetDeliveryDestinationRequest.Builder> getDeliveryDestinationRequest) Retrieves complete information about one delivery destination.default GetDeliveryDestinationResponsegetDeliveryDestination(GetDeliveryDestinationRequest getDeliveryDestinationRequest) Retrieves complete information about one delivery destination.getDeliveryDestinationPolicy(Consumer<GetDeliveryDestinationPolicyRequest.Builder> getDeliveryDestinationPolicyRequest) Retrieves the delivery destination policy assigned to the delivery destination that you specify.getDeliveryDestinationPolicy(GetDeliveryDestinationPolicyRequest getDeliveryDestinationPolicyRequest) Retrieves the delivery destination policy assigned to the delivery destination that you specify.default GetDeliverySourceResponsegetDeliverySource(Consumer<GetDeliverySourceRequest.Builder> getDeliverySourceRequest) Retrieves complete information about one delivery source.default GetDeliverySourceResponsegetDeliverySource(GetDeliverySourceRequest getDeliverySourceRequest) Retrieves complete information about one delivery source.default GetLogAnomalyDetectorResponsegetLogAnomalyDetector(Consumer<GetLogAnomalyDetectorRequest.Builder> getLogAnomalyDetectorRequest) Retrieves information about the log anomaly detector that you specify.default GetLogAnomalyDetectorResponsegetLogAnomalyDetector(GetLogAnomalyDetectorRequest getLogAnomalyDetectorRequest) Retrieves information about the log anomaly detector that you specify.default GetLogEventsResponsegetLogEvents(Consumer<GetLogEventsRequest.Builder> getLogEventsRequest) Lists log events from the specified log stream.default GetLogEventsResponsegetLogEvents(GetLogEventsRequest getLogEventsRequest) Lists log events from the specified log stream.default GetLogEventsIterablegetLogEventsPaginator(Consumer<GetLogEventsRequest.Builder> getLogEventsRequest) This is a variant ofgetLogEvents(software.amazon.awssdk.services.cloudwatchlogs.model.GetLogEventsRequest)operation.default GetLogEventsIterablegetLogEventsPaginator(GetLogEventsRequest getLogEventsRequest) This is a variant ofgetLogEvents(software.amazon.awssdk.services.cloudwatchlogs.model.GetLogEventsRequest)operation.default GetLogGroupFieldsResponsegetLogGroupFields(Consumer<GetLogGroupFieldsRequest.Builder> getLogGroupFieldsRequest) Returns a list of the fields that are included in log events in the specified log group.default GetLogGroupFieldsResponsegetLogGroupFields(GetLogGroupFieldsRequest getLogGroupFieldsRequest) Returns a list of the fields that are included in log events in the specified log group.default GetLogRecordResponsegetLogRecord(Consumer<GetLogRecordRequest.Builder> getLogRecordRequest) Retrieves all of the fields and values of a single log event.default GetLogRecordResponsegetLogRecord(GetLogRecordRequest getLogRecordRequest) Retrieves all of the fields and values of a single log event.default GetQueryResultsResponsegetQueryResults(Consumer<GetQueryResultsRequest.Builder> getQueryResultsRequest) Returns the results from the specified query.default GetQueryResultsResponsegetQueryResults(GetQueryResultsRequest getQueryResultsRequest) Returns the results from the specified query.default ListAnomaliesResponselistAnomalies(Consumer<ListAnomaliesRequest.Builder> listAnomaliesRequest) Returns a list of anomalies that log anomaly detectors have found.default ListAnomaliesResponselistAnomalies(ListAnomaliesRequest listAnomaliesRequest) Returns a list of anomalies that log anomaly detectors have found.default ListAnomaliesIterablelistAnomaliesPaginator(Consumer<ListAnomaliesRequest.Builder> listAnomaliesRequest) This is a variant oflistAnomalies(software.amazon.awssdk.services.cloudwatchlogs.model.ListAnomaliesRequest)operation.default ListAnomaliesIterablelistAnomaliesPaginator(ListAnomaliesRequest listAnomaliesRequest) This is a variant oflistAnomalies(software.amazon.awssdk.services.cloudwatchlogs.model.ListAnomaliesRequest)operation.default ListLogAnomalyDetectorsResponselistLogAnomalyDetectors(Consumer<ListLogAnomalyDetectorsRequest.Builder> listLogAnomalyDetectorsRequest) Retrieves a list of the log anomaly detectors in the account.default ListLogAnomalyDetectorsResponselistLogAnomalyDetectors(ListLogAnomalyDetectorsRequest listLogAnomalyDetectorsRequest) Retrieves a list of the log anomaly detectors in the account.default ListLogAnomalyDetectorsIterablelistLogAnomalyDetectorsPaginator(Consumer<ListLogAnomalyDetectorsRequest.Builder> listLogAnomalyDetectorsRequest) This is a variant oflistLogAnomalyDetectors(software.amazon.awssdk.services.cloudwatchlogs.model.ListLogAnomalyDetectorsRequest)operation.default ListLogAnomalyDetectorsIterablelistLogAnomalyDetectorsPaginator(ListLogAnomalyDetectorsRequest listLogAnomalyDetectorsRequest) This is a variant oflistLogAnomalyDetectors(software.amazon.awssdk.services.cloudwatchlogs.model.ListLogAnomalyDetectorsRequest)operation.default ListTagsForResourceResponselistTagsForResource(Consumer<ListTagsForResourceRequest.Builder> listTagsForResourceRequest) Displays the tags associated with a CloudWatch Logs resource.default ListTagsForResourceResponselistTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) Displays the tags associated with a CloudWatch Logs resource.default ListTagsLogGroupResponselistTagsLogGroup(Consumer<ListTagsLogGroupRequest.Builder> listTagsLogGroupRequest) Deprecated.Please use the generic tagging API ListTagsForResourcedefault ListTagsLogGroupResponselistTagsLogGroup(ListTagsLogGroupRequest listTagsLogGroupRequest) Deprecated.Please use the generic tagging API ListTagsForResourcedefault PutAccountPolicyResponseputAccountPolicy(Consumer<PutAccountPolicyRequest.Builder> putAccountPolicyRequest) 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.default PutAccountPolicyResponseputAccountPolicy(PutAccountPolicyRequest putAccountPolicyRequest) 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.default PutDataProtectionPolicyResponseputDataProtectionPolicy(Consumer<PutDataProtectionPolicyRequest.Builder> putDataProtectionPolicyRequest) Creates a data protection policy for the specified log group.default PutDataProtectionPolicyResponseputDataProtectionPolicy(PutDataProtectionPolicyRequest putDataProtectionPolicyRequest) Creates a data protection policy for the specified log group.default PutDeliveryDestinationResponseputDeliveryDestination(Consumer<PutDeliveryDestinationRequest.Builder> putDeliveryDestinationRequest) Creates or updates a logical delivery destination.default PutDeliveryDestinationResponseputDeliveryDestination(PutDeliveryDestinationRequest putDeliveryDestinationRequest) Creates or updates a logical delivery destination.putDeliveryDestinationPolicy(Consumer<PutDeliveryDestinationPolicyRequest.Builder> putDeliveryDestinationPolicyRequest) Creates and assigns an IAM policy that grants permissions to CloudWatch Logs to deliver logs cross-account to a specified destination in this account.putDeliveryDestinationPolicy(PutDeliveryDestinationPolicyRequest putDeliveryDestinationPolicyRequest) Creates and assigns an IAM policy that grants permissions to CloudWatch Logs to deliver logs cross-account to a specified destination in this account.default PutDeliverySourceResponseputDeliverySource(Consumer<PutDeliverySourceRequest.Builder> putDeliverySourceRequest) Creates or updates a logical delivery source.default PutDeliverySourceResponseputDeliverySource(PutDeliverySourceRequest putDeliverySourceRequest) Creates or updates a logical delivery source.default PutDestinationResponseputDestination(Consumer<PutDestinationRequest.Builder> putDestinationRequest) Creates or updates a destination.default PutDestinationResponseputDestination(PutDestinationRequest putDestinationRequest) Creates or updates a destination.default PutDestinationPolicyResponseputDestinationPolicy(Consumer<PutDestinationPolicyRequest.Builder> putDestinationPolicyRequest) Creates or updates an access policy associated with an existing destination.default PutDestinationPolicyResponseputDestinationPolicy(PutDestinationPolicyRequest putDestinationPolicyRequest) Creates or updates an access policy associated with an existing destination.default PutLogEventsResponseputLogEvents(Consumer<PutLogEventsRequest.Builder> putLogEventsRequest) Uploads a batch of log events to the specified log stream.default PutLogEventsResponseputLogEvents(PutLogEventsRequest putLogEventsRequest) Uploads a batch of log events to the specified log stream.default PutMetricFilterResponseputMetricFilter(Consumer<PutMetricFilterRequest.Builder> putMetricFilterRequest) Creates or updates a metric filter and associates it with the specified log group.default PutMetricFilterResponseputMetricFilter(PutMetricFilterRequest putMetricFilterRequest) Creates or updates a metric filter and associates it with the specified log group.default PutQueryDefinitionResponseputQueryDefinition(Consumer<PutQueryDefinitionRequest.Builder> putQueryDefinitionRequest) Creates or updates a query definition for CloudWatch Logs Insights.default PutQueryDefinitionResponseputQueryDefinition(PutQueryDefinitionRequest putQueryDefinitionRequest) Creates or updates a query definition for CloudWatch Logs Insights.default PutResourcePolicyResponseputResourcePolicy(Consumer<PutResourcePolicyRequest.Builder> putResourcePolicyRequest) Creates or updates a resource policy allowing other Amazon Web Services services to put log events to this account, such as Amazon Route 53.default PutResourcePolicyResponseputResourcePolicy(PutResourcePolicyRequest putResourcePolicyRequest) Creates or updates a resource policy allowing other Amazon Web Services services to put log events to this account, such as Amazon Route 53.default PutRetentionPolicyResponseputRetentionPolicy(Consumer<PutRetentionPolicyRequest.Builder> putRetentionPolicyRequest) Sets the retention of the specified log group.default PutRetentionPolicyResponseputRetentionPolicy(PutRetentionPolicyRequest putRetentionPolicyRequest) Sets the retention of the specified log group.default PutSubscriptionFilterResponseputSubscriptionFilter(Consumer<PutSubscriptionFilterRequest.Builder> putSubscriptionFilterRequest) Creates or updates a subscription filter and associates it with the specified log group.default PutSubscriptionFilterResponseputSubscriptionFilter(PutSubscriptionFilterRequest putSubscriptionFilterRequest) Creates or updates a subscription filter and associates it with the specified log group.The SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfigurationstatic ServiceMetadatadefault StartQueryResponsestartQuery(Consumer<StartQueryRequest.Builder> startQueryRequest) Schedules a query of a log group using CloudWatch Logs Insights.default StartQueryResponsestartQuery(StartQueryRequest startQueryRequest) Schedules a query of a log group using CloudWatch Logs Insights.default StopQueryResponsestopQuery(Consumer<StopQueryRequest.Builder> stopQueryRequest) Stops a CloudWatch Logs Insights query that is in progress.default StopQueryResponsestopQuery(StopQueryRequest stopQueryRequest) Stops a CloudWatch Logs Insights query that is in progress.default TagLogGroupResponsetagLogGroup(Consumer<TagLogGroupRequest.Builder> tagLogGroupRequest) Deprecated.Please use the generic tagging API TagResourcedefault TagLogGroupResponsetagLogGroup(TagLogGroupRequest tagLogGroupRequest) Deprecated.Please use the generic tagging API TagResourcedefault TagResourceResponsetagResource(Consumer<TagResourceRequest.Builder> tagResourceRequest) Assigns one or more tags (key-value pairs) to the specified CloudWatch Logs resource.default TagResourceResponsetagResource(TagResourceRequest tagResourceRequest) Assigns one or more tags (key-value pairs) to the specified CloudWatch Logs resource.default TestMetricFilterResponsetestMetricFilter(Consumer<TestMetricFilterRequest.Builder> testMetricFilterRequest) Tests the filter pattern of a metric filter against a sample of log event messages.default TestMetricFilterResponsetestMetricFilter(TestMetricFilterRequest testMetricFilterRequest) Tests the filter pattern of a metric filter against a sample of log event messages.default UntagLogGroupResponseuntagLogGroup(Consumer<UntagLogGroupRequest.Builder> untagLogGroupRequest) Deprecated.Please use the generic tagging API UntagResourcedefault UntagLogGroupResponseuntagLogGroup(UntagLogGroupRequest untagLogGroupRequest) Deprecated.Please use the generic tagging API UntagResourcedefault UntagResourceResponseuntagResource(Consumer<UntagResourceRequest.Builder> untagResourceRequest) Removes one or more tags from the specified resource.default UntagResourceResponseuntagResource(UntagResourceRequest untagResourceRequest) Removes one or more tags from the specified resource.default UpdateAnomalyResponseupdateAnomaly(Consumer<UpdateAnomalyRequest.Builder> updateAnomalyRequest) Use this operation to suppress anomaly detection for a specified anomaly or pattern.default UpdateAnomalyResponseupdateAnomaly(UpdateAnomalyRequest updateAnomalyRequest) Use this operation to suppress anomaly detection for a specified anomaly or pattern.updateDeliveryConfiguration(Consumer<UpdateDeliveryConfigurationRequest.Builder> updateDeliveryConfigurationRequest) Use this operation to update the configuration of a delivery to change either the S3 path pattern or the format of the delivered logs.updateDeliveryConfiguration(UpdateDeliveryConfigurationRequest updateDeliveryConfigurationRequest) Use this operation to update the configuration of a delivery to change either the S3 path pattern or the format of the delivered logs.default UpdateLogAnomalyDetectorResponseupdateLogAnomalyDetector(Consumer<UpdateLogAnomalyDetectorRequest.Builder> updateLogAnomalyDetectorRequest) Updates an existing log anomaly detector.default UpdateLogAnomalyDetectorResponseupdateLogAnomalyDetector(UpdateLogAnomalyDetectorRequest updateLogAnomalyDetectorRequest) Updates an existing log anomaly detector.Methods inherited from interface software.amazon.awssdk.utils.SdkAutoCloseable
closeMethods inherited from interface software.amazon.awssdk.core.SdkClient
serviceName
-
Field Details
-
SERVICE_NAME
- See Also:
-
SERVICE_METADATA_ID
Value for looking up the service's metadata from theServiceMetadataProvider.- See Also:
-
-
Method Details
-
associateKmsKey
default AssociateKmsKeyResponse associateKmsKey(AssociateKmsKeyRequest associateKmsKeyRequest) throws InvalidParameterException, ResourceNotFoundException, OperationAbortedException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException 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.
When you use
AssociateKmsKey, you specify either thelogGroupNameparameter or theresourceIdentifierparameter. You can't specify both of those parameters in the same operation.-
Specify the
logGroupNameparameter to cause all log events stored in the log group to be encrypted with that key. Only the log events ingested after the key is associated are encrypted with that key.Associating a KMS key with a log group overrides any existing associations between the log group and a KMS key. After a KMS key is associated with a log group, all newly ingested data for the log group is encrypted using the KMS key. This association is stored as long as the data encrypted with the KMS key is still within CloudWatch Logs. This enables CloudWatch Logs to decrypt this data whenever it is requested.
Associating a key with a log group does not cause the results of queries of that log group to be encrypted with that key. To have query results encrypted with a KMS key, you must use an
AssociateKmsKeyoperation with theresourceIdentifierparameter that specifies aquery-resultresource. -
Specify the
resourceIdentifierparameter with aquery-resultresource, to use that key to encrypt the stored results of all future StartQuery operations in the account. The response from a GetQueryResults operation will still return the query results in plain text.Even if you have not associated a key with your query results, the query results are encrypted when stored, using the default CloudWatch Logs method.
If you run a query from a monitoring account that queries logs in a source account, the query results key from the monitoring account, if any, is used.
If you delete the key that is used to encrypt log events or log group query results, then all the associated stored log events or query results that were encrypted with that key will be unencryptable and unusable.
CloudWatch Logs supports only symmetric KMS keys. Do not use an associate an asymmetric KMS key with your log group or query results. For more information, see Using Symmetric and Asymmetric Keys.
It can take up to 5 minutes for this operation to take effect.
If you attempt to associate a KMS key with a log group but the KMS key does not exist or the KMS key is disabled, you receive an
InvalidParameterExceptionerror.- Parameters:
associateKmsKeyRequest-- Returns:
- Result of the AssociateKmsKey operation returned by the service.
- See Also:
-
-
associateKmsKey
default AssociateKmsKeyResponse associateKmsKey(Consumer<AssociateKmsKeyRequest.Builder> associateKmsKeyRequest) throws InvalidParameterException, ResourceNotFoundException, OperationAbortedException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException 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.
When you use
AssociateKmsKey, you specify either thelogGroupNameparameter or theresourceIdentifierparameter. You can't specify both of those parameters in the same operation.-
Specify the
logGroupNameparameter to cause all log events stored in the log group to be encrypted with that key. Only the log events ingested after the key is associated are encrypted with that key.Associating a KMS key with a log group overrides any existing associations between the log group and a KMS key. After a KMS key is associated with a log group, all newly ingested data for the log group is encrypted using the KMS key. This association is stored as long as the data encrypted with the KMS key is still within CloudWatch Logs. This enables CloudWatch Logs to decrypt this data whenever it is requested.
Associating a key with a log group does not cause the results of queries of that log group to be encrypted with that key. To have query results encrypted with a KMS key, you must use an
AssociateKmsKeyoperation with theresourceIdentifierparameter that specifies aquery-resultresource. -
Specify the
resourceIdentifierparameter with aquery-resultresource, to use that key to encrypt the stored results of all future StartQuery operations in the account. The response from a GetQueryResults operation will still return the query results in plain text.Even if you have not associated a key with your query results, the query results are encrypted when stored, using the default CloudWatch Logs method.
If you run a query from a monitoring account that queries logs in a source account, the query results key from the monitoring account, if any, is used.
If you delete the key that is used to encrypt log events or log group query results, then all the associated stored log events or query results that were encrypted with that key will be unencryptable and unusable.
CloudWatch Logs supports only symmetric KMS keys. Do not use an associate an asymmetric KMS key with your log group or query results. For more information, see Using Symmetric and Asymmetric Keys.
It can take up to 5 minutes for this operation to take effect.
If you attempt to associate a KMS key with a log group but the KMS key does not exist or the KMS key is disabled, you receive an
InvalidParameterExceptionerror.
This is a convenience which creates an instance of the
AssociateKmsKeyRequest.Builderavoiding the need to create one manually viaAssociateKmsKeyRequest.builder()- Parameters:
associateKmsKeyRequest- AConsumerthat will call methods onAssociateKmsKeyRequest.Builderto create a request.- Returns:
- Result of the AssociateKmsKey operation returned by the service.
- See Also:
-
-
cancelExportTask
default CancelExportTaskResponse cancelExportTask(CancelExportTaskRequest cancelExportTaskRequest) throws InvalidParameterException, ResourceNotFoundException, InvalidOperationException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Cancels the specified export task.
The task must be in the
PENDINGorRUNNINGstate.- Parameters:
cancelExportTaskRequest-- Returns:
- Result of the CancelExportTask operation returned by the service.
- See Also:
-
cancelExportTask
default CancelExportTaskResponse cancelExportTask(Consumer<CancelExportTaskRequest.Builder> cancelExportTaskRequest) throws InvalidParameterException, ResourceNotFoundException, InvalidOperationException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Cancels the specified export task.
The task must be in the
PENDINGorRUNNINGstate.
This is a convenience which creates an instance of the
CancelExportTaskRequest.Builderavoiding the need to create one manually viaCancelExportTaskRequest.builder()- Parameters:
cancelExportTaskRequest- AConsumerthat will call methods onCancelExportTaskRequest.Builderto create a request.- Returns:
- Result of the CancelExportTask operation returned by the service.
- See Also:
-
createDelivery
default CreateDeliveryResponse createDelivery(CreateDeliveryRequest createDeliveryRequest) throws ServiceUnavailableException, ConflictException, ResourceNotFoundException, ValidationException, AccessDeniedException, ServiceQuotaExceededException, ThrottlingException, AwsServiceException, SdkClientException, CloudWatchLogsException Creates a delivery. A delivery is a connection between a logical delivery source and a logical delivery destination that you have already created.
Only some Amazon Web Services services support being configured as a delivery source using this operation. These services are listed as Supported [V2 Permissions] in the table at Enabling logging from Amazon Web Services services.
A delivery destination can represent a log group in CloudWatch Logs, an Amazon S3 bucket, or a delivery stream in Firehose.
To configure logs delivery between a supported Amazon Web Services service and a destination, you must do the following:
-
Create a delivery source, which is a logical object that represents the resource that is actually sending the logs. For more information, see PutDeliverySource.
-
Create a delivery destination, which is a logical object that represents the actual delivery destination. For more information, see PutDeliveryDestination.
-
If you are delivering logs cross-account, you must use PutDeliveryDestinationPolicy in the destination account to assign an IAM policy to the destination. This policy allows delivery to that destination.
-
Use
CreateDeliveryto create a delivery by pairing exactly one delivery source and one delivery destination.
You can configure a single delivery source to send logs to multiple destinations by creating multiple deliveries. You can also create multiple deliveries to configure multiple delivery sources to send logs to the same delivery destination.
To update an existing delivery configuration, use UpdateDeliveryConfiguration.
- Parameters:
createDeliveryRequest-- Returns:
- Result of the CreateDelivery operation returned by the service.
- See Also:
-
-
createDelivery
default CreateDeliveryResponse createDelivery(Consumer<CreateDeliveryRequest.Builder> createDeliveryRequest) throws ServiceUnavailableException, ConflictException, ResourceNotFoundException, ValidationException, AccessDeniedException, ServiceQuotaExceededException, ThrottlingException, AwsServiceException, SdkClientException, CloudWatchLogsException Creates a delivery. A delivery is a connection between a logical delivery source and a logical delivery destination that you have already created.
Only some Amazon Web Services services support being configured as a delivery source using this operation. These services are listed as Supported [V2 Permissions] in the table at Enabling logging from Amazon Web Services services.
A delivery destination can represent a log group in CloudWatch Logs, an Amazon S3 bucket, or a delivery stream in Firehose.
To configure logs delivery between a supported Amazon Web Services service and a destination, you must do the following:
-
Create a delivery source, which is a logical object that represents the resource that is actually sending the logs. For more information, see PutDeliverySource.
-
Create a delivery destination, which is a logical object that represents the actual delivery destination. For more information, see PutDeliveryDestination.
-
If you are delivering logs cross-account, you must use PutDeliveryDestinationPolicy in the destination account to assign an IAM policy to the destination. This policy allows delivery to that destination.
-
Use
CreateDeliveryto create a delivery by pairing exactly one delivery source and one delivery destination.
You can configure a single delivery source to send logs to multiple destinations by creating multiple deliveries. You can also create multiple deliveries to configure multiple delivery sources to send logs to the same delivery destination.
To update an existing delivery configuration, use UpdateDeliveryConfiguration.
This is a convenience which creates an instance of the
CreateDeliveryRequest.Builderavoiding the need to create one manually viaCreateDeliveryRequest.builder()- Parameters:
createDeliveryRequest- AConsumerthat will call methods onCreateDeliveryRequest.Builderto create a request.- Returns:
- Result of the CreateDelivery operation returned by the service.
- See Also:
-
-
createExportTask
default CreateExportTaskResponse createExportTask(CreateExportTaskRequest createExportTaskRequest) throws InvalidParameterException, LimitExceededException, OperationAbortedException, ServiceUnavailableException, ResourceNotFoundException, ResourceAlreadyExistsException, AwsServiceException, SdkClientException, CloudWatchLogsException Creates an export task so that you can efficiently export data from a log group to an Amazon S3 bucket. When you perform a
CreateExportTaskoperation, you must use credentials that have permission to write to the S3 bucket that you specify as the destination.Exporting log data to S3 buckets that are encrypted by KMS is supported. Exporting log data to Amazon S3 buckets that have S3 Object Lock enabled with a retention period is also supported.
Exporting to S3 buckets that are encrypted with AES-256 is supported.
This is an asynchronous call. If all the required information is provided, this operation initiates an export task and responds with the ID of the task. After the task has started, you can use DescribeExportTasks to get the status of the export task. Each account can only have one active (
RUNNINGorPENDING) export task at a time. To cancel an export task, use CancelExportTask.You can export logs from multiple log groups or multiple time ranges to the same S3 bucket. To separate log data for each export task, specify a prefix to be used as the Amazon S3 key prefix for all exported objects.
Time-based sorting on chunks of log data inside an exported file is not guaranteed. You can sort the exported log field data by using Linux utilities.
- Parameters:
createExportTaskRequest-- Returns:
- Result of the CreateExportTask operation returned by the service.
- See Also:
-
createExportTask
default CreateExportTaskResponse createExportTask(Consumer<CreateExportTaskRequest.Builder> createExportTaskRequest) throws InvalidParameterException, LimitExceededException, OperationAbortedException, ServiceUnavailableException, ResourceNotFoundException, ResourceAlreadyExistsException, AwsServiceException, SdkClientException, CloudWatchLogsException Creates an export task so that you can efficiently export data from a log group to an Amazon S3 bucket. When you perform a
CreateExportTaskoperation, you must use credentials that have permission to write to the S3 bucket that you specify as the destination.Exporting log data to S3 buckets that are encrypted by KMS is supported. Exporting log data to Amazon S3 buckets that have S3 Object Lock enabled with a retention period is also supported.
Exporting to S3 buckets that are encrypted with AES-256 is supported.
This is an asynchronous call. If all the required information is provided, this operation initiates an export task and responds with the ID of the task. After the task has started, you can use DescribeExportTasks to get the status of the export task. Each account can only have one active (
RUNNINGorPENDING) export task at a time. To cancel an export task, use CancelExportTask.You can export logs from multiple log groups or multiple time ranges to the same S3 bucket. To separate log data for each export task, specify a prefix to be used as the Amazon S3 key prefix for all exported objects.
Time-based sorting on chunks of log data inside an exported file is not guaranteed. You can sort the exported log field data by using Linux utilities.
This is a convenience which creates an instance of the
CreateExportTaskRequest.Builderavoiding the need to create one manually viaCreateExportTaskRequest.builder()- Parameters:
createExportTaskRequest- AConsumerthat will call methods onCreateExportTaskRequest.Builderto create a request.- Returns:
- Result of the CreateExportTask operation returned by the service.
- See Also:
-
createLogAnomalyDetector
default CreateLogAnomalyDetectorResponse createLogAnomalyDetector(CreateLogAnomalyDetectorRequest createLogAnomalyDetectorRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, OperationAbortedException, LimitExceededException, AwsServiceException, SdkClientException, CloudWatchLogsException Creates an anomaly detector that regularly scans one or more log groups and look for patterns and anomalies in the logs.
An anomaly detector can help surface issues by automatically discovering anomalies in your log event traffic. An anomaly detector uses machine learning algorithms to scan log events and find patterns. A pattern is a shared text structure that recurs among your log fields. Patterns provide a useful tool for analyzing large sets of logs because a large number of log events can often be compressed into a few patterns.
The anomaly detector uses pattern recognition to find
anomalies, which are unusual log events. It uses theevaluationFrequencyto compare current log events and patterns with trained baselines.Fields within a pattern are called tokens. Fields that vary within a pattern, such as a request ID or timestamp, are referred to as dynamic tokens and represented by
<*>.The following is an example of a pattern:
[INFO] Request time: <*> msThis pattern represents log events like
[INFO] Request time: 327 msand other similar log events that differ only by the number, in this csse 327. When the pattern is displayed, the different numbers are replaced by<*>Any parts of log events that are masked as sensitive data are not scanned for anomalies. For more information about masking sensitive data, see Help protect sensitive log data with masking.
- Parameters:
createLogAnomalyDetectorRequest-- Returns:
- Result of the CreateLogAnomalyDetector operation returned by the service.
- See Also:
-
createLogAnomalyDetector
default CreateLogAnomalyDetectorResponse createLogAnomalyDetector(Consumer<CreateLogAnomalyDetectorRequest.Builder> createLogAnomalyDetectorRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, OperationAbortedException, LimitExceededException, AwsServiceException, SdkClientException, CloudWatchLogsException Creates an anomaly detector that regularly scans one or more log groups and look for patterns and anomalies in the logs.
An anomaly detector can help surface issues by automatically discovering anomalies in your log event traffic. An anomaly detector uses machine learning algorithms to scan log events and find patterns. A pattern is a shared text structure that recurs among your log fields. Patterns provide a useful tool for analyzing large sets of logs because a large number of log events can often be compressed into a few patterns.
The anomaly detector uses pattern recognition to find
anomalies, which are unusual log events. It uses theevaluationFrequencyto compare current log events and patterns with trained baselines.Fields within a pattern are called tokens. Fields that vary within a pattern, such as a request ID or timestamp, are referred to as dynamic tokens and represented by
<*>.The following is an example of a pattern:
[INFO] Request time: <*> msThis pattern represents log events like
[INFO] Request time: 327 msand other similar log events that differ only by the number, in this csse 327. When the pattern is displayed, the different numbers are replaced by<*>Any parts of log events that are masked as sensitive data are not scanned for anomalies. For more information about masking sensitive data, see Help protect sensitive log data with masking.
This is a convenience which creates an instance of the
CreateLogAnomalyDetectorRequest.Builderavoiding the need to create one manually viaCreateLogAnomalyDetectorRequest.builder()- Parameters:
createLogAnomalyDetectorRequest- AConsumerthat will call methods onCreateLogAnomalyDetectorRequest.Builderto create a request.- Returns:
- Result of the CreateLogAnomalyDetector operation returned by the service.
- See Also:
-
createLogGroup
default CreateLogGroupResponse createLogGroup(CreateLogGroupRequest createLogGroupRequest) throws InvalidParameterException, ResourceAlreadyExistsException, LimitExceededException, OperationAbortedException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Creates a log group with the specified name. You can create up to 1,000,000 log groups per Region per account.
You must use the following guidelines when naming a log group:
-
Log group names must be unique within a Region for an Amazon Web Services account.
-
Log group names can be between 1 and 512 characters long.
-
Log group names consist of the following characters: a-z, A-Z, 0-9, '_' (underscore), '-' (hyphen), '/' (forward slash), '.' (period), and '#' (number sign)
-
Log group names can't start with the string
aws/
When you create a log group, by default the log events in the log group do not expire. To set a retention policy so that events expire and are deleted after a specified time, use PutRetentionPolicy.
If you associate an KMS key with the log group, ingested data is encrypted using the KMS key. This association is stored as long as the data encrypted with the KMS key is still within CloudWatch Logs. This enables CloudWatch Logs to decrypt this data whenever it is requested.
If you attempt to associate a KMS key with the log group but the KMS key does not exist or the KMS key is disabled, you receive an
InvalidParameterExceptionerror.CloudWatch Logs supports only symmetric KMS keys. Do not associate an asymmetric KMS key with your log group. For more information, see Using Symmetric and Asymmetric Keys.
- Parameters:
createLogGroupRequest-- Returns:
- Result of the CreateLogGroup operation returned by the service.
- See Also:
-
-
createLogGroup
default CreateLogGroupResponse createLogGroup(Consumer<CreateLogGroupRequest.Builder> createLogGroupRequest) throws InvalidParameterException, ResourceAlreadyExistsException, LimitExceededException, OperationAbortedException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Creates a log group with the specified name. You can create up to 1,000,000 log groups per Region per account.
You must use the following guidelines when naming a log group:
-
Log group names must be unique within a Region for an Amazon Web Services account.
-
Log group names can be between 1 and 512 characters long.
-
Log group names consist of the following characters: a-z, A-Z, 0-9, '_' (underscore), '-' (hyphen), '/' (forward slash), '.' (period), and '#' (number sign)
-
Log group names can't start with the string
aws/
When you create a log group, by default the log events in the log group do not expire. To set a retention policy so that events expire and are deleted after a specified time, use PutRetentionPolicy.
If you associate an KMS key with the log group, ingested data is encrypted using the KMS key. This association is stored as long as the data encrypted with the KMS key is still within CloudWatch Logs. This enables CloudWatch Logs to decrypt this data whenever it is requested.
If you attempt to associate a KMS key with the log group but the KMS key does not exist or the KMS key is disabled, you receive an
InvalidParameterExceptionerror.CloudWatch Logs supports only symmetric KMS keys. Do not associate an asymmetric KMS key with your log group. For more information, see Using Symmetric and Asymmetric Keys.
This is a convenience which creates an instance of the
CreateLogGroupRequest.Builderavoiding the need to create one manually viaCreateLogGroupRequest.builder()- Parameters:
createLogGroupRequest- AConsumerthat will call methods onCreateLogGroupRequest.Builderto create a request.- Returns:
- Result of the CreateLogGroup operation returned by the service.
- See Also:
-
-
createLogStream
default CreateLogStreamResponse createLogStream(CreateLogStreamRequest createLogStreamRequest) throws InvalidParameterException, ResourceAlreadyExistsException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Creates a log stream for the specified log group. A log stream is a sequence of log events that originate from a single source, such as an application instance or a resource that is being monitored.
There is no limit on the number of log streams that you can create for a log group. There is a limit of 50 TPS on
CreateLogStreamoperations, after which transactions are throttled.You must use the following guidelines when naming a log stream:
-
Log stream names must be unique within the log group.
-
Log stream names can be between 1 and 512 characters long.
-
Don't use ':' (colon) or '*' (asterisk) characters.
- Parameters:
createLogStreamRequest-- Returns:
- Result of the CreateLogStream operation returned by the service.
- See Also:
-
-
createLogStream
default CreateLogStreamResponse createLogStream(Consumer<CreateLogStreamRequest.Builder> createLogStreamRequest) throws InvalidParameterException, ResourceAlreadyExistsException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Creates a log stream for the specified log group. A log stream is a sequence of log events that originate from a single source, such as an application instance or a resource that is being monitored.
There is no limit on the number of log streams that you can create for a log group. There is a limit of 50 TPS on
CreateLogStreamoperations, after which transactions are throttled.You must use the following guidelines when naming a log stream:
-
Log stream names must be unique within the log group.
-
Log stream names can be between 1 and 512 characters long.
-
Don't use ':' (colon) or '*' (asterisk) characters.
This is a convenience which creates an instance of the
CreateLogStreamRequest.Builderavoiding the need to create one manually viaCreateLogStreamRequest.builder()- Parameters:
createLogStreamRequest- AConsumerthat will call methods onCreateLogStreamRequest.Builderto create a request.- Returns:
- Result of the CreateLogStream operation returned by the service.
- See Also:
-
-
deleteAccountPolicy
default DeleteAccountPolicyResponse deleteAccountPolicy(DeleteAccountPolicyRequest deleteAccountPolicyRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, OperationAbortedException, AwsServiceException, SdkClientException, CloudWatchLogsException Deletes a CloudWatch Logs account policy. This stops the policy from applying to all log groups or a subset of log groups in the account. Log-group level policies will still be in effect.
To use this operation, you must be signed on with the correct permissions depending on the type of policy that you are deleting.
-
To delete a data protection policy, you must have the
logs:DeleteDataProtectionPolicyandlogs:DeleteAccountPolicypermissions. -
To delete a subscription filter policy, you must have the
logs:DeleteSubscriptionFilterandlogs:DeleteAccountPolicypermissions.
- Parameters:
deleteAccountPolicyRequest-- Returns:
- Result of the DeleteAccountPolicy operation returned by the service.
- See Also:
-
-
deleteAccountPolicy
default DeleteAccountPolicyResponse deleteAccountPolicy(Consumer<DeleteAccountPolicyRequest.Builder> deleteAccountPolicyRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, OperationAbortedException, AwsServiceException, SdkClientException, CloudWatchLogsException Deletes a CloudWatch Logs account policy. This stops the policy from applying to all log groups or a subset of log groups in the account. Log-group level policies will still be in effect.
To use this operation, you must be signed on with the correct permissions depending on the type of policy that you are deleting.
-
To delete a data protection policy, you must have the
logs:DeleteDataProtectionPolicyandlogs:DeleteAccountPolicypermissions. -
To delete a subscription filter policy, you must have the
logs:DeleteSubscriptionFilterandlogs:DeleteAccountPolicypermissions.
This is a convenience which creates an instance of the
DeleteAccountPolicyRequest.Builderavoiding the need to create one manually viaDeleteAccountPolicyRequest.builder()- Parameters:
deleteAccountPolicyRequest- AConsumerthat will call methods onDeleteAccountPolicyRequest.Builderto create a request.- Returns:
- Result of the DeleteAccountPolicy operation returned by the service.
- See Also:
-
-
deleteDataProtectionPolicy
default DeleteDataProtectionPolicyResponse deleteDataProtectionPolicy(DeleteDataProtectionPolicyRequest deleteDataProtectionPolicyRequest) throws InvalidParameterException, OperationAbortedException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Deletes the data protection policy from the specified log group.
For more information about data protection policies, see PutDataProtectionPolicy.
- Parameters:
deleteDataProtectionPolicyRequest-- Returns:
- Result of the DeleteDataProtectionPolicy operation returned by the service.
- See Also:
-
deleteDataProtectionPolicy
default DeleteDataProtectionPolicyResponse deleteDataProtectionPolicy(Consumer<DeleteDataProtectionPolicyRequest.Builder> deleteDataProtectionPolicyRequest) throws InvalidParameterException, OperationAbortedException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Deletes the data protection policy from the specified log group.
For more information about data protection policies, see PutDataProtectionPolicy.
This is a convenience which creates an instance of the
DeleteDataProtectionPolicyRequest.Builderavoiding the need to create one manually viaDeleteDataProtectionPolicyRequest.builder()- Parameters:
deleteDataProtectionPolicyRequest- AConsumerthat will call methods onDeleteDataProtectionPolicyRequest.Builderto create a request.- Returns:
- Result of the DeleteDataProtectionPolicy operation returned by the service.
- See Also:
-
deleteDelivery
default DeleteDeliveryResponse deleteDelivery(DeleteDeliveryRequest deleteDeliveryRequest) throws ResourceNotFoundException, ServiceUnavailableException, ConflictException, ValidationException, ServiceQuotaExceededException, ThrottlingException, AwsServiceException, SdkClientException, CloudWatchLogsException Deletes s delivery. A delivery is a connection between a logical delivery source and a logical delivery destination. Deleting a delivery only deletes the connection between the delivery source and delivery destination. It does not delete the delivery destination or the delivery source.
- Parameters:
deleteDeliveryRequest-- Returns:
- Result of the DeleteDelivery operation returned by the service.
- See Also:
-
deleteDelivery
default DeleteDeliveryResponse deleteDelivery(Consumer<DeleteDeliveryRequest.Builder> deleteDeliveryRequest) throws ResourceNotFoundException, ServiceUnavailableException, ConflictException, ValidationException, ServiceQuotaExceededException, ThrottlingException, AwsServiceException, SdkClientException, CloudWatchLogsException Deletes s delivery. A delivery is a connection between a logical delivery source and a logical delivery destination. Deleting a delivery only deletes the connection between the delivery source and delivery destination. It does not delete the delivery destination or the delivery source.
This is a convenience which creates an instance of the
DeleteDeliveryRequest.Builderavoiding the need to create one manually viaDeleteDeliveryRequest.builder()- Parameters:
deleteDeliveryRequest- AConsumerthat will call methods onDeleteDeliveryRequest.Builderto create a request.- Returns:
- Result of the DeleteDelivery operation returned by the service.
- See Also:
-
deleteDeliveryDestination
default DeleteDeliveryDestinationResponse deleteDeliveryDestination(DeleteDeliveryDestinationRequest deleteDeliveryDestinationRequest) throws ResourceNotFoundException, ServiceUnavailableException, ConflictException, ValidationException, ServiceQuotaExceededException, ThrottlingException, AwsServiceException, SdkClientException, CloudWatchLogsException Deletes a delivery destination. A delivery is a connection between a logical delivery source and a logical delivery destination.
You can't delete a delivery destination if any current deliveries are associated with it. To find whether any deliveries are associated with this delivery destination, use the DescribeDeliveries operation and check the
deliveryDestinationArnfield in the results.- Parameters:
deleteDeliveryDestinationRequest-- Returns:
- Result of the DeleteDeliveryDestination operation returned by the service.
- See Also:
-
deleteDeliveryDestination
default DeleteDeliveryDestinationResponse deleteDeliveryDestination(Consumer<DeleteDeliveryDestinationRequest.Builder> deleteDeliveryDestinationRequest) throws ResourceNotFoundException, ServiceUnavailableException, ConflictException, ValidationException, ServiceQuotaExceededException, ThrottlingException, AwsServiceException, SdkClientException, CloudWatchLogsException Deletes a delivery destination. A delivery is a connection between a logical delivery source and a logical delivery destination.
You can't delete a delivery destination if any current deliveries are associated with it. To find whether any deliveries are associated with this delivery destination, use the DescribeDeliveries operation and check the
deliveryDestinationArnfield in the results.
This is a convenience which creates an instance of the
DeleteDeliveryDestinationRequest.Builderavoiding the need to create one manually viaDeleteDeliveryDestinationRequest.builder()- Parameters:
deleteDeliveryDestinationRequest- AConsumerthat will call methods onDeleteDeliveryDestinationRequest.Builderto create a request.- Returns:
- Result of the DeleteDeliveryDestination operation returned by the service.
- See Also:
-
deleteDeliveryDestinationPolicy
default DeleteDeliveryDestinationPolicyResponse deleteDeliveryDestinationPolicy(DeleteDeliveryDestinationPolicyRequest deleteDeliveryDestinationPolicyRequest) throws ServiceUnavailableException, ValidationException, ResourceNotFoundException, ConflictException, AwsServiceException, SdkClientException, CloudWatchLogsException Deletes a delivery destination policy. For more information about these policies, see PutDeliveryDestinationPolicy.
- Parameters:
deleteDeliveryDestinationPolicyRequest-- Returns:
- Result of the DeleteDeliveryDestinationPolicy operation returned by the service.
- See Also:
-
deleteDeliveryDestinationPolicy
default DeleteDeliveryDestinationPolicyResponse deleteDeliveryDestinationPolicy(Consumer<DeleteDeliveryDestinationPolicyRequest.Builder> deleteDeliveryDestinationPolicyRequest) throws ServiceUnavailableException, ValidationException, ResourceNotFoundException, ConflictException, AwsServiceException, SdkClientException, CloudWatchLogsException Deletes a delivery destination policy. For more information about these policies, see PutDeliveryDestinationPolicy.
This is a convenience which creates an instance of the
DeleteDeliveryDestinationPolicyRequest.Builderavoiding the need to create one manually viaDeleteDeliveryDestinationPolicyRequest.builder()- Parameters:
deleteDeliveryDestinationPolicyRequest- AConsumerthat will call methods onDeleteDeliveryDestinationPolicyRequest.Builderto create a request.- Returns:
- Result of the DeleteDeliveryDestinationPolicy operation returned by the service.
- See Also:
-
deleteDeliverySource
default DeleteDeliverySourceResponse deleteDeliverySource(DeleteDeliverySourceRequest deleteDeliverySourceRequest) throws ResourceNotFoundException, ServiceUnavailableException, ConflictException, ValidationException, ServiceQuotaExceededException, ThrottlingException, AwsServiceException, SdkClientException, CloudWatchLogsException Deletes a delivery source. A delivery is a connection between a logical delivery source and a logical delivery destination.
You can't delete a delivery source if any current deliveries are associated with it. To find whether any deliveries are associated with this delivery source, use the DescribeDeliveries operation and check the
deliverySourceNamefield in the results.- Parameters:
deleteDeliverySourceRequest-- Returns:
- Result of the DeleteDeliverySource operation returned by the service.
- See Also:
-
deleteDeliverySource
default DeleteDeliverySourceResponse deleteDeliverySource(Consumer<DeleteDeliverySourceRequest.Builder> deleteDeliverySourceRequest) throws ResourceNotFoundException, ServiceUnavailableException, ConflictException, ValidationException, ServiceQuotaExceededException, ThrottlingException, AwsServiceException, SdkClientException, CloudWatchLogsException Deletes a delivery source. A delivery is a connection between a logical delivery source and a logical delivery destination.
You can't delete a delivery source if any current deliveries are associated with it. To find whether any deliveries are associated with this delivery source, use the DescribeDeliveries operation and check the
deliverySourceNamefield in the results.
This is a convenience which creates an instance of the
DeleteDeliverySourceRequest.Builderavoiding the need to create one manually viaDeleteDeliverySourceRequest.builder()- Parameters:
deleteDeliverySourceRequest- AConsumerthat will call methods onDeleteDeliverySourceRequest.Builderto create a request.- Returns:
- Result of the DeleteDeliverySource operation returned by the service.
- See Also:
-
deleteDestination
default DeleteDestinationResponse deleteDestination(DeleteDestinationRequest deleteDestinationRequest) throws InvalidParameterException, ResourceNotFoundException, OperationAbortedException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Deletes the specified destination, and eventually disables all the subscription filters that publish to it. This operation does not delete the physical resource encapsulated by the destination.
- Parameters:
deleteDestinationRequest-- Returns:
- Result of the DeleteDestination operation returned by the service.
- See Also:
-
deleteDestination
default DeleteDestinationResponse deleteDestination(Consumer<DeleteDestinationRequest.Builder> deleteDestinationRequest) throws InvalidParameterException, ResourceNotFoundException, OperationAbortedException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Deletes the specified destination, and eventually disables all the subscription filters that publish to it. This operation does not delete the physical resource encapsulated by the destination.
This is a convenience which creates an instance of the
DeleteDestinationRequest.Builderavoiding the need to create one manually viaDeleteDestinationRequest.builder()- Parameters:
deleteDestinationRequest- AConsumerthat will call methods onDeleteDestinationRequest.Builderto create a request.- Returns:
- Result of the DeleteDestination operation returned by the service.
- See Also:
-
deleteLogAnomalyDetector
default DeleteLogAnomalyDetectorResponse deleteLogAnomalyDetector(DeleteLogAnomalyDetectorRequest deleteLogAnomalyDetectorRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, OperationAbortedException, AwsServiceException, SdkClientException, CloudWatchLogsException Deletes the specified CloudWatch Logs anomaly detector.
- Parameters:
deleteLogAnomalyDetectorRequest-- Returns:
- Result of the DeleteLogAnomalyDetector operation returned by the service.
- See Also:
-
deleteLogAnomalyDetector
default DeleteLogAnomalyDetectorResponse deleteLogAnomalyDetector(Consumer<DeleteLogAnomalyDetectorRequest.Builder> deleteLogAnomalyDetectorRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, OperationAbortedException, AwsServiceException, SdkClientException, CloudWatchLogsException Deletes the specified CloudWatch Logs anomaly detector.
This is a convenience which creates an instance of the
DeleteLogAnomalyDetectorRequest.Builderavoiding the need to create one manually viaDeleteLogAnomalyDetectorRequest.builder()- Parameters:
deleteLogAnomalyDetectorRequest- AConsumerthat will call methods onDeleteLogAnomalyDetectorRequest.Builderto create a request.- Returns:
- Result of the DeleteLogAnomalyDetector operation returned by the service.
- See Also:
-
deleteLogGroup
default DeleteLogGroupResponse deleteLogGroup(DeleteLogGroupRequest deleteLogGroupRequest) throws InvalidParameterException, ResourceNotFoundException, OperationAbortedException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Deletes the specified log group and permanently deletes all the archived log events associated with the log group.
- Parameters:
deleteLogGroupRequest-- Returns:
- Result of the DeleteLogGroup operation returned by the service.
- See Also:
-
deleteLogGroup
default DeleteLogGroupResponse deleteLogGroup(Consumer<DeleteLogGroupRequest.Builder> deleteLogGroupRequest) throws InvalidParameterException, ResourceNotFoundException, OperationAbortedException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Deletes the specified log group and permanently deletes all the archived log events associated with the log group.
This is a convenience which creates an instance of the
DeleteLogGroupRequest.Builderavoiding the need to create one manually viaDeleteLogGroupRequest.builder()- Parameters:
deleteLogGroupRequest- AConsumerthat will call methods onDeleteLogGroupRequest.Builderto create a request.- Returns:
- Result of the DeleteLogGroup operation returned by the service.
- See Also:
-
deleteLogStream
default DeleteLogStreamResponse deleteLogStream(DeleteLogStreamRequest deleteLogStreamRequest) throws InvalidParameterException, ResourceNotFoundException, OperationAbortedException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Deletes the specified log stream and permanently deletes all the archived log events associated with the log stream.
- Parameters:
deleteLogStreamRequest-- Returns:
- Result of the DeleteLogStream operation returned by the service.
- See Also:
-
deleteLogStream
default DeleteLogStreamResponse deleteLogStream(Consumer<DeleteLogStreamRequest.Builder> deleteLogStreamRequest) throws InvalidParameterException, ResourceNotFoundException, OperationAbortedException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Deletes the specified log stream and permanently deletes all the archived log events associated with the log stream.
This is a convenience which creates an instance of the
DeleteLogStreamRequest.Builderavoiding the need to create one manually viaDeleteLogStreamRequest.builder()- Parameters:
deleteLogStreamRequest- AConsumerthat will call methods onDeleteLogStreamRequest.Builderto create a request.- Returns:
- Result of the DeleteLogStream operation returned by the service.
- See Also:
-
deleteMetricFilter
default DeleteMetricFilterResponse deleteMetricFilter(DeleteMetricFilterRequest deleteMetricFilterRequest) throws InvalidParameterException, ResourceNotFoundException, OperationAbortedException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Deletes the specified metric filter.
- Parameters:
deleteMetricFilterRequest-- Returns:
- Result of the DeleteMetricFilter operation returned by the service.
- See Also:
-
deleteMetricFilter
default DeleteMetricFilterResponse deleteMetricFilter(Consumer<DeleteMetricFilterRequest.Builder> deleteMetricFilterRequest) throws InvalidParameterException, ResourceNotFoundException, OperationAbortedException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Deletes the specified metric filter.
This is a convenience which creates an instance of the
DeleteMetricFilterRequest.Builderavoiding the need to create one manually viaDeleteMetricFilterRequest.builder()- Parameters:
deleteMetricFilterRequest- AConsumerthat will call methods onDeleteMetricFilterRequest.Builderto create a request.- Returns:
- Result of the DeleteMetricFilter operation returned by the service.
- See Also:
-
deleteQueryDefinition
default DeleteQueryDefinitionResponse deleteQueryDefinition(DeleteQueryDefinitionRequest deleteQueryDefinitionRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Deletes a saved CloudWatch Logs Insights query definition. A query definition contains details about a saved CloudWatch Logs Insights query.
Each
DeleteQueryDefinitionoperation can delete one query definition.You must have the
logs:DeleteQueryDefinitionpermission to be able to perform this operation.- Parameters:
deleteQueryDefinitionRequest-- Returns:
- Result of the DeleteQueryDefinition operation returned by the service.
- See Also:
-
deleteQueryDefinition
default DeleteQueryDefinitionResponse deleteQueryDefinition(Consumer<DeleteQueryDefinitionRequest.Builder> deleteQueryDefinitionRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Deletes a saved CloudWatch Logs Insights query definition. A query definition contains details about a saved CloudWatch Logs Insights query.
Each
DeleteQueryDefinitionoperation can delete one query definition.You must have the
logs:DeleteQueryDefinitionpermission to be able to perform this operation.
This is a convenience which creates an instance of the
DeleteQueryDefinitionRequest.Builderavoiding the need to create one manually viaDeleteQueryDefinitionRequest.builder()- Parameters:
deleteQueryDefinitionRequest- AConsumerthat will call methods onDeleteQueryDefinitionRequest.Builderto create a request.- Returns:
- Result of the DeleteQueryDefinition operation returned by the service.
- See Also:
-
deleteResourcePolicy
default DeleteResourcePolicyResponse deleteResourcePolicy(DeleteResourcePolicyRequest deleteResourcePolicyRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Deletes a resource policy from this account. This revokes the access of the identities in that policy to put log events to this account.
- Parameters:
deleteResourcePolicyRequest-- Returns:
- Result of the DeleteResourcePolicy operation returned by the service.
- See Also:
-
deleteResourcePolicy
default DeleteResourcePolicyResponse deleteResourcePolicy(Consumer<DeleteResourcePolicyRequest.Builder> deleteResourcePolicyRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Deletes a resource policy from this account. This revokes the access of the identities in that policy to put log events to this account.
This is a convenience which creates an instance of the
DeleteResourcePolicyRequest.Builderavoiding the need to create one manually viaDeleteResourcePolicyRequest.builder()- Parameters:
deleteResourcePolicyRequest- AConsumerthat will call methods onDeleteResourcePolicyRequest.Builderto create a request.- Returns:
- Result of the DeleteResourcePolicy operation returned by the service.
- See Also:
-
deleteRetentionPolicy
default DeleteRetentionPolicyResponse deleteRetentionPolicy(DeleteRetentionPolicyRequest deleteRetentionPolicyRequest) throws InvalidParameterException, ResourceNotFoundException, OperationAbortedException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Deletes the specified retention policy.
Log events do not expire if they belong to log groups without a retention policy.
- Parameters:
deleteRetentionPolicyRequest-- Returns:
- Result of the DeleteRetentionPolicy operation returned by the service.
- See Also:
-
deleteRetentionPolicy
default DeleteRetentionPolicyResponse deleteRetentionPolicy(Consumer<DeleteRetentionPolicyRequest.Builder> deleteRetentionPolicyRequest) throws InvalidParameterException, ResourceNotFoundException, OperationAbortedException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Deletes the specified retention policy.
Log events do not expire if they belong to log groups without a retention policy.
This is a convenience which creates an instance of the
DeleteRetentionPolicyRequest.Builderavoiding the need to create one manually viaDeleteRetentionPolicyRequest.builder()- Parameters:
deleteRetentionPolicyRequest- AConsumerthat will call methods onDeleteRetentionPolicyRequest.Builderto create a request.- Returns:
- Result of the DeleteRetentionPolicy operation returned by the service.
- See Also:
-
deleteSubscriptionFilter
default DeleteSubscriptionFilterResponse deleteSubscriptionFilter(DeleteSubscriptionFilterRequest deleteSubscriptionFilterRequest) throws InvalidParameterException, ResourceNotFoundException, OperationAbortedException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Deletes the specified subscription filter.
- Parameters:
deleteSubscriptionFilterRequest-- Returns:
- Result of the DeleteSubscriptionFilter operation returned by the service.
- See Also:
-
deleteSubscriptionFilter
default DeleteSubscriptionFilterResponse deleteSubscriptionFilter(Consumer<DeleteSubscriptionFilterRequest.Builder> deleteSubscriptionFilterRequest) throws InvalidParameterException, ResourceNotFoundException, OperationAbortedException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Deletes the specified subscription filter.
This is a convenience which creates an instance of the
DeleteSubscriptionFilterRequest.Builderavoiding the need to create one manually viaDeleteSubscriptionFilterRequest.builder()- Parameters:
deleteSubscriptionFilterRequest- AConsumerthat will call methods onDeleteSubscriptionFilterRequest.Builderto create a request.- Returns:
- Result of the DeleteSubscriptionFilter operation returned by the service.
- See Also:
-
describeAccountPolicies
default DescribeAccountPoliciesResponse describeAccountPolicies(DescribeAccountPoliciesRequest describeAccountPoliciesRequest) throws InvalidParameterException, OperationAbortedException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Returns a list of all CloudWatch Logs account policies in the account.
- Parameters:
describeAccountPoliciesRequest-- Returns:
- Result of the DescribeAccountPolicies operation returned by the service.
- See Also:
-
describeAccountPolicies
default DescribeAccountPoliciesResponse describeAccountPolicies(Consumer<DescribeAccountPoliciesRequest.Builder> describeAccountPoliciesRequest) throws InvalidParameterException, OperationAbortedException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Returns a list of all CloudWatch Logs account policies in the account.
This is a convenience which creates an instance of the
DescribeAccountPoliciesRequest.Builderavoiding the need to create one manually viaDescribeAccountPoliciesRequest.builder()- Parameters:
describeAccountPoliciesRequest- AConsumerthat will call methods onDescribeAccountPoliciesRequest.Builderto create a request.- Returns:
- Result of the DescribeAccountPolicies operation returned by the service.
- See Also:
-
describeConfigurationTemplates
default DescribeConfigurationTemplatesResponse describeConfigurationTemplates(DescribeConfigurationTemplatesRequest describeConfigurationTemplatesRequest) throws ServiceUnavailableException, ValidationException, ResourceNotFoundException, ThrottlingException, AwsServiceException, SdkClientException, CloudWatchLogsException Use this operation to return the valid and default values that are used when creating delivery sources, delivery destinations, and deliveries. For more information about deliveries, see CreateDelivery.
- Parameters:
describeConfigurationTemplatesRequest-- Returns:
- Result of the DescribeConfigurationTemplates operation returned by the service.
- See Also:
-
describeConfigurationTemplates
default DescribeConfigurationTemplatesResponse describeConfigurationTemplates(Consumer<DescribeConfigurationTemplatesRequest.Builder> describeConfigurationTemplatesRequest) throws ServiceUnavailableException, ValidationException, ResourceNotFoundException, ThrottlingException, AwsServiceException, SdkClientException, CloudWatchLogsException Use this operation to return the valid and default values that are used when creating delivery sources, delivery destinations, and deliveries. For more information about deliveries, see CreateDelivery.
This is a convenience which creates an instance of the
DescribeConfigurationTemplatesRequest.Builderavoiding the need to create one manually viaDescribeConfigurationTemplatesRequest.builder()- Parameters:
describeConfigurationTemplatesRequest- AConsumerthat will call methods onDescribeConfigurationTemplatesRequest.Builderto create a request.- Returns:
- Result of the DescribeConfigurationTemplates operation returned by the service.
- See Also:
-
describeConfigurationTemplatesPaginator
default DescribeConfigurationTemplatesIterable describeConfigurationTemplatesPaginator(DescribeConfigurationTemplatesRequest describeConfigurationTemplatesRequest) throws ServiceUnavailableException, ValidationException, ResourceNotFoundException, ThrottlingException, AwsServiceException, SdkClientException, CloudWatchLogsException This is a variant of
describeConfigurationTemplates(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeConfigurationTemplatesRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeConfigurationTemplatesIterable responses = client.describeConfigurationTemplatesPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeConfigurationTemplatesIterable responses = client .describeConfigurationTemplatesPaginator(request); for (software.amazon.awssdk.services.cloudwatchlogs.model.DescribeConfigurationTemplatesResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeConfigurationTemplatesIterable responses = client.describeConfigurationTemplatesPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of limit won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
describeConfigurationTemplates(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeConfigurationTemplatesRequest)operation.- Parameters:
describeConfigurationTemplatesRequest-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
describeConfigurationTemplatesPaginator
default DescribeConfigurationTemplatesIterable describeConfigurationTemplatesPaginator(Consumer<DescribeConfigurationTemplatesRequest.Builder> describeConfigurationTemplatesRequest) throws ServiceUnavailableException, ValidationException, ResourceNotFoundException, ThrottlingException, AwsServiceException, SdkClientException, CloudWatchLogsException This is a variant of
describeConfigurationTemplates(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeConfigurationTemplatesRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeConfigurationTemplatesIterable responses = client.describeConfigurationTemplatesPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeConfigurationTemplatesIterable responses = client .describeConfigurationTemplatesPaginator(request); for (software.amazon.awssdk.services.cloudwatchlogs.model.DescribeConfigurationTemplatesResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeConfigurationTemplatesIterable responses = client.describeConfigurationTemplatesPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of limit won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
describeConfigurationTemplates(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeConfigurationTemplatesRequest)operation.
This is a convenience which creates an instance of the
DescribeConfigurationTemplatesRequest.Builderavoiding the need to create one manually viaDescribeConfigurationTemplatesRequest.builder()- Parameters:
describeConfigurationTemplatesRequest- AConsumerthat will call methods onDescribeConfigurationTemplatesRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
describeDeliveries
default DescribeDeliveriesResponse describeDeliveries(DescribeDeliveriesRequest describeDeliveriesRequest) throws ServiceUnavailableException, ServiceQuotaExceededException, ValidationException, ThrottlingException, AwsServiceException, SdkClientException, CloudWatchLogsException Retrieves a list of the deliveries that have been created in the account.
A delivery is a connection between a delivery source and a delivery destination .
A delivery source represents an Amazon Web Services resource that sends logs to an logs delivery destination. The destination can be CloudWatch Logs, Amazon S3, or Firehose. Only some Amazon Web Services services support being configured as a delivery source. These services are listed in Enable logging from Amazon Web Services services.
- Parameters:
describeDeliveriesRequest-- Returns:
- Result of the DescribeDeliveries operation returned by the service.
- See Also:
-
describeDeliveries
default DescribeDeliveriesResponse describeDeliveries(Consumer<DescribeDeliveriesRequest.Builder> describeDeliveriesRequest) throws ServiceUnavailableException, ServiceQuotaExceededException, ValidationException, ThrottlingException, AwsServiceException, SdkClientException, CloudWatchLogsException Retrieves a list of the deliveries that have been created in the account.
A delivery is a connection between a delivery source and a delivery destination .
A delivery source represents an Amazon Web Services resource that sends logs to an logs delivery destination. The destination can be CloudWatch Logs, Amazon S3, or Firehose. Only some Amazon Web Services services support being configured as a delivery source. These services are listed in Enable logging from Amazon Web Services services.
This is a convenience which creates an instance of the
DescribeDeliveriesRequest.Builderavoiding the need to create one manually viaDescribeDeliveriesRequest.builder()- Parameters:
describeDeliveriesRequest- AConsumerthat will call methods onDescribeDeliveriesRequest.Builderto create a request.- Returns:
- Result of the DescribeDeliveries operation returned by the service.
- See Also:
-
describeDeliveriesPaginator
default DescribeDeliveriesIterable describeDeliveriesPaginator(DescribeDeliveriesRequest describeDeliveriesRequest) throws ServiceUnavailableException, ServiceQuotaExceededException, ValidationException, ThrottlingException, AwsServiceException, SdkClientException, CloudWatchLogsException This is a variant of
describeDeliveries(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeDeliveriesRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeDeliveriesIterable responses = client.describeDeliveriesPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeDeliveriesIterable responses = client .describeDeliveriesPaginator(request); for (software.amazon.awssdk.services.cloudwatchlogs.model.DescribeDeliveriesResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeDeliveriesIterable responses = client.describeDeliveriesPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of limit won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
describeDeliveries(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeDeliveriesRequest)operation.- Parameters:
describeDeliveriesRequest-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
describeDeliveriesPaginator
default DescribeDeliveriesIterable describeDeliveriesPaginator(Consumer<DescribeDeliveriesRequest.Builder> describeDeliveriesRequest) throws ServiceUnavailableException, ServiceQuotaExceededException, ValidationException, ThrottlingException, AwsServiceException, SdkClientException, CloudWatchLogsException This is a variant of
describeDeliveries(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeDeliveriesRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeDeliveriesIterable responses = client.describeDeliveriesPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeDeliveriesIterable responses = client .describeDeliveriesPaginator(request); for (software.amazon.awssdk.services.cloudwatchlogs.model.DescribeDeliveriesResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeDeliveriesIterable responses = client.describeDeliveriesPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of limit won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
describeDeliveries(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeDeliveriesRequest)operation.
This is a convenience which creates an instance of the
DescribeDeliveriesRequest.Builderavoiding the need to create one manually viaDescribeDeliveriesRequest.builder()- Parameters:
describeDeliveriesRequest- AConsumerthat will call methods onDescribeDeliveriesRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
describeDeliveryDestinations
default DescribeDeliveryDestinationsResponse describeDeliveryDestinations(DescribeDeliveryDestinationsRequest describeDeliveryDestinationsRequest) throws ServiceUnavailableException, ServiceQuotaExceededException, ValidationException, ThrottlingException, AwsServiceException, SdkClientException, CloudWatchLogsException Retrieves a list of the delivery destinations that have been created in the account.
- Parameters:
describeDeliveryDestinationsRequest-- Returns:
- Result of the DescribeDeliveryDestinations operation returned by the service.
- See Also:
-
describeDeliveryDestinations
default DescribeDeliveryDestinationsResponse describeDeliveryDestinations(Consumer<DescribeDeliveryDestinationsRequest.Builder> describeDeliveryDestinationsRequest) throws ServiceUnavailableException, ServiceQuotaExceededException, ValidationException, ThrottlingException, AwsServiceException, SdkClientException, CloudWatchLogsException Retrieves a list of the delivery destinations that have been created in the account.
This is a convenience which creates an instance of the
DescribeDeliveryDestinationsRequest.Builderavoiding the need to create one manually viaDescribeDeliveryDestinationsRequest.builder()- Parameters:
describeDeliveryDestinationsRequest- AConsumerthat will call methods onDescribeDeliveryDestinationsRequest.Builderto create a request.- Returns:
- Result of the DescribeDeliveryDestinations operation returned by the service.
- See Also:
-
describeDeliveryDestinationsPaginator
default DescribeDeliveryDestinationsIterable describeDeliveryDestinationsPaginator(DescribeDeliveryDestinationsRequest describeDeliveryDestinationsRequest) throws ServiceUnavailableException, ServiceQuotaExceededException, ValidationException, ThrottlingException, AwsServiceException, SdkClientException, CloudWatchLogsException This is a variant of
describeDeliveryDestinations(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeDeliveryDestinationsRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeDeliveryDestinationsIterable responses = client.describeDeliveryDestinationsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeDeliveryDestinationsIterable responses = client .describeDeliveryDestinationsPaginator(request); for (software.amazon.awssdk.services.cloudwatchlogs.model.DescribeDeliveryDestinationsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeDeliveryDestinationsIterable responses = client.describeDeliveryDestinationsPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of limit won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
describeDeliveryDestinations(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeDeliveryDestinationsRequest)operation.- Parameters:
describeDeliveryDestinationsRequest-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
describeDeliveryDestinationsPaginator
default DescribeDeliveryDestinationsIterable describeDeliveryDestinationsPaginator(Consumer<DescribeDeliveryDestinationsRequest.Builder> describeDeliveryDestinationsRequest) throws ServiceUnavailableException, ServiceQuotaExceededException, ValidationException, ThrottlingException, AwsServiceException, SdkClientException, CloudWatchLogsException This is a variant of
describeDeliveryDestinations(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeDeliveryDestinationsRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeDeliveryDestinationsIterable responses = client.describeDeliveryDestinationsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeDeliveryDestinationsIterable responses = client .describeDeliveryDestinationsPaginator(request); for (software.amazon.awssdk.services.cloudwatchlogs.model.DescribeDeliveryDestinationsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeDeliveryDestinationsIterable responses = client.describeDeliveryDestinationsPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of limit won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
describeDeliveryDestinations(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeDeliveryDestinationsRequest)operation.
This is a convenience which creates an instance of the
DescribeDeliveryDestinationsRequest.Builderavoiding the need to create one manually viaDescribeDeliveryDestinationsRequest.builder()- Parameters:
describeDeliveryDestinationsRequest- AConsumerthat will call methods onDescribeDeliveryDestinationsRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
describeDeliverySources
default DescribeDeliverySourcesResponse describeDeliverySources(DescribeDeliverySourcesRequest describeDeliverySourcesRequest) throws ServiceUnavailableException, ServiceQuotaExceededException, ValidationException, ThrottlingException, AwsServiceException, SdkClientException, CloudWatchLogsException Retrieves a list of the delivery sources that have been created in the account.
- Parameters:
describeDeliverySourcesRequest-- Returns:
- Result of the DescribeDeliverySources operation returned by the service.
- See Also:
-
describeDeliverySources
default DescribeDeliverySourcesResponse describeDeliverySources(Consumer<DescribeDeliverySourcesRequest.Builder> describeDeliverySourcesRequest) throws ServiceUnavailableException, ServiceQuotaExceededException, ValidationException, ThrottlingException, AwsServiceException, SdkClientException, CloudWatchLogsException Retrieves a list of the delivery sources that have been created in the account.
This is a convenience which creates an instance of the
DescribeDeliverySourcesRequest.Builderavoiding the need to create one manually viaDescribeDeliverySourcesRequest.builder()- Parameters:
describeDeliverySourcesRequest- AConsumerthat will call methods onDescribeDeliverySourcesRequest.Builderto create a request.- Returns:
- Result of the DescribeDeliverySources operation returned by the service.
- See Also:
-
describeDeliverySourcesPaginator
default DescribeDeliverySourcesIterable describeDeliverySourcesPaginator(DescribeDeliverySourcesRequest describeDeliverySourcesRequest) throws ServiceUnavailableException, ServiceQuotaExceededException, ValidationException, ThrottlingException, AwsServiceException, SdkClientException, CloudWatchLogsException This is a variant of
describeDeliverySources(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeDeliverySourcesRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeDeliverySourcesIterable responses = client.describeDeliverySourcesPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeDeliverySourcesIterable responses = client .describeDeliverySourcesPaginator(request); for (software.amazon.awssdk.services.cloudwatchlogs.model.DescribeDeliverySourcesResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeDeliverySourcesIterable responses = client.describeDeliverySourcesPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of limit won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
describeDeliverySources(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeDeliverySourcesRequest)operation.- Parameters:
describeDeliverySourcesRequest-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
describeDeliverySourcesPaginator
default DescribeDeliverySourcesIterable describeDeliverySourcesPaginator(Consumer<DescribeDeliverySourcesRequest.Builder> describeDeliverySourcesRequest) throws ServiceUnavailableException, ServiceQuotaExceededException, ValidationException, ThrottlingException, AwsServiceException, SdkClientException, CloudWatchLogsException This is a variant of
describeDeliverySources(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeDeliverySourcesRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeDeliverySourcesIterable responses = client.describeDeliverySourcesPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeDeliverySourcesIterable responses = client .describeDeliverySourcesPaginator(request); for (software.amazon.awssdk.services.cloudwatchlogs.model.DescribeDeliverySourcesResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeDeliverySourcesIterable responses = client.describeDeliverySourcesPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of limit won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
describeDeliverySources(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeDeliverySourcesRequest)operation.
This is a convenience which creates an instance of the
DescribeDeliverySourcesRequest.Builderavoiding the need to create one manually viaDescribeDeliverySourcesRequest.builder()- Parameters:
describeDeliverySourcesRequest- AConsumerthat will call methods onDescribeDeliverySourcesRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
describeDestinations
default DescribeDestinationsResponse describeDestinations(DescribeDestinationsRequest describeDestinationsRequest) throws InvalidParameterException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Lists all your destinations. The results are ASCII-sorted by destination name.
- Parameters:
describeDestinationsRequest-- Returns:
- Result of the DescribeDestinations operation returned by the service.
- See Also:
-
describeDestinations
default DescribeDestinationsResponse describeDestinations(Consumer<DescribeDestinationsRequest.Builder> describeDestinationsRequest) throws InvalidParameterException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Lists all your destinations. The results are ASCII-sorted by destination name.
This is a convenience which creates an instance of the
DescribeDestinationsRequest.Builderavoiding the need to create one manually viaDescribeDestinationsRequest.builder()- Parameters:
describeDestinationsRequest- AConsumerthat will call methods onDescribeDestinationsRequest.Builderto create a request.- Returns:
- Result of the DescribeDestinations operation returned by the service.
- See Also:
-
describeDestinations
default DescribeDestinationsResponse describeDestinations() throws InvalidParameterException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsExceptionLists all your destinations. The results are ASCII-sorted by destination name.
- Returns:
- Result of the DescribeDestinations operation returned by the service.
- See Also:
-
describeDestinationsPaginator
default DescribeDestinationsIterable describeDestinationsPaginator() throws InvalidParameterException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsExceptionThis is a variant of
describeDestinations(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeDestinationsRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeDestinationsIterable responses = client.describeDestinationsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeDestinationsIterable responses = client .describeDestinationsPaginator(request); for (software.amazon.awssdk.services.cloudwatchlogs.model.DescribeDestinationsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeDestinationsIterable responses = client.describeDestinationsPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of limit won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
describeDestinations(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeDestinationsRequest)operation.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
describeDestinationsPaginator
default DescribeDestinationsIterable describeDestinationsPaginator(DescribeDestinationsRequest describeDestinationsRequest) throws InvalidParameterException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException This is a variant of
describeDestinations(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeDestinationsRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeDestinationsIterable responses = client.describeDestinationsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeDestinationsIterable responses = client .describeDestinationsPaginator(request); for (software.amazon.awssdk.services.cloudwatchlogs.model.DescribeDestinationsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeDestinationsIterable responses = client.describeDestinationsPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of limit won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
describeDestinations(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeDestinationsRequest)operation.- Parameters:
describeDestinationsRequest-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
describeDestinationsPaginator
default DescribeDestinationsIterable describeDestinationsPaginator(Consumer<DescribeDestinationsRequest.Builder> describeDestinationsRequest) throws InvalidParameterException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException This is a variant of
describeDestinations(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeDestinationsRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeDestinationsIterable responses = client.describeDestinationsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeDestinationsIterable responses = client .describeDestinationsPaginator(request); for (software.amazon.awssdk.services.cloudwatchlogs.model.DescribeDestinationsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeDestinationsIterable responses = client.describeDestinationsPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of limit won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
describeDestinations(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeDestinationsRequest)operation.
This is a convenience which creates an instance of the
DescribeDestinationsRequest.Builderavoiding the need to create one manually viaDescribeDestinationsRequest.builder()- Parameters:
describeDestinationsRequest- AConsumerthat will call methods onDescribeDestinationsRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
describeExportTasks
default DescribeExportTasksResponse describeExportTasks(DescribeExportTasksRequest describeExportTasksRequest) throws InvalidParameterException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Lists the specified export tasks. You can list all your export tasks or filter the results based on task ID or task status.
- Parameters:
describeExportTasksRequest-- Returns:
- Result of the DescribeExportTasks operation returned by the service.
- See Also:
-
describeExportTasks
default DescribeExportTasksResponse describeExportTasks(Consumer<DescribeExportTasksRequest.Builder> describeExportTasksRequest) throws InvalidParameterException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Lists the specified export tasks. You can list all your export tasks or filter the results based on task ID or task status.
This is a convenience which creates an instance of the
DescribeExportTasksRequest.Builderavoiding the need to create one manually viaDescribeExportTasksRequest.builder()- Parameters:
describeExportTasksRequest- AConsumerthat will call methods onDescribeExportTasksRequest.Builderto create a request.- Returns:
- Result of the DescribeExportTasks operation returned by the service.
- See Also:
-
describeExportTasks
default DescribeExportTasksResponse describeExportTasks() throws InvalidParameterException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsExceptionLists the specified export tasks. You can list all your export tasks or filter the results based on task ID or task status.
- Returns:
- Result of the DescribeExportTasks operation returned by the service.
- See Also:
-
describeLogGroups
default DescribeLogGroupsResponse describeLogGroups(DescribeLogGroupsRequest describeLogGroupsRequest) throws InvalidParameterException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Lists the specified log groups. You can list all your log groups or filter the results by prefix. The results are ASCII-sorted by log group name.
CloudWatch Logs doesn't support IAM policies that control access to the
DescribeLogGroupsaction by using theaws:ResourceTag/key-namecondition key. Other CloudWatch Logs actions do support the use of theaws:ResourceTag/key-namecondition key to control access. For more information about using tags to control access, see Controlling access to Amazon Web Services resources using tags.If you are using CloudWatch cross-account observability, you can use this operation in a monitoring account and view data from the linked source accounts. For more information, see CloudWatch cross-account observability.
- Parameters:
describeLogGroupsRequest-- Returns:
- Result of the DescribeLogGroups operation returned by the service.
- See Also:
-
describeLogGroups
default DescribeLogGroupsResponse describeLogGroups(Consumer<DescribeLogGroupsRequest.Builder> describeLogGroupsRequest) throws InvalidParameterException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Lists the specified log groups. You can list all your log groups or filter the results by prefix. The results are ASCII-sorted by log group name.
CloudWatch Logs doesn't support IAM policies that control access to the
DescribeLogGroupsaction by using theaws:ResourceTag/key-namecondition key. Other CloudWatch Logs actions do support the use of theaws:ResourceTag/key-namecondition key to control access. For more information about using tags to control access, see Controlling access to Amazon Web Services resources using tags.If you are using CloudWatch cross-account observability, you can use this operation in a monitoring account and view data from the linked source accounts. For more information, see CloudWatch cross-account observability.
This is a convenience which creates an instance of the
DescribeLogGroupsRequest.Builderavoiding the need to create one manually viaDescribeLogGroupsRequest.builder()- Parameters:
describeLogGroupsRequest- AConsumerthat will call methods onDescribeLogGroupsRequest.Builderto create a request.- Returns:
- Result of the DescribeLogGroups operation returned by the service.
- See Also:
-
describeLogGroups
default DescribeLogGroupsResponse describeLogGroups() throws InvalidParameterException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsExceptionLists the specified log groups. You can list all your log groups or filter the results by prefix. The results are ASCII-sorted by log group name.
CloudWatch Logs doesn't support IAM policies that control access to the
DescribeLogGroupsaction by using theaws:ResourceTag/key-namecondition key. Other CloudWatch Logs actions do support the use of theaws:ResourceTag/key-namecondition key to control access. For more information about using tags to control access, see Controlling access to Amazon Web Services resources using tags.If you are using CloudWatch cross-account observability, you can use this operation in a monitoring account and view data from the linked source accounts. For more information, see CloudWatch cross-account observability.
- Returns:
- Result of the DescribeLogGroups operation returned by the service.
- See Also:
-
describeLogGroupsPaginator
default DescribeLogGroupsIterable describeLogGroupsPaginator() throws InvalidParameterException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsExceptionThis is a variant of
describeLogGroups(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeLogGroupsRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeLogGroupsIterable responses = client.describeLogGroupsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeLogGroupsIterable responses = client .describeLogGroupsPaginator(request); for (software.amazon.awssdk.services.cloudwatchlogs.model.DescribeLogGroupsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeLogGroupsIterable responses = client.describeLogGroupsPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of limit won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
describeLogGroups(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeLogGroupsRequest)operation.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
describeLogGroupsPaginator
default DescribeLogGroupsIterable describeLogGroupsPaginator(DescribeLogGroupsRequest describeLogGroupsRequest) throws InvalidParameterException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException This is a variant of
describeLogGroups(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeLogGroupsRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeLogGroupsIterable responses = client.describeLogGroupsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeLogGroupsIterable responses = client .describeLogGroupsPaginator(request); for (software.amazon.awssdk.services.cloudwatchlogs.model.DescribeLogGroupsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeLogGroupsIterable responses = client.describeLogGroupsPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of limit won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
describeLogGroups(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeLogGroupsRequest)operation.- Parameters:
describeLogGroupsRequest-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
describeLogGroupsPaginator
default DescribeLogGroupsIterable describeLogGroupsPaginator(Consumer<DescribeLogGroupsRequest.Builder> describeLogGroupsRequest) throws InvalidParameterException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException This is a variant of
describeLogGroups(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeLogGroupsRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeLogGroupsIterable responses = client.describeLogGroupsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeLogGroupsIterable responses = client .describeLogGroupsPaginator(request); for (software.amazon.awssdk.services.cloudwatchlogs.model.DescribeLogGroupsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeLogGroupsIterable responses = client.describeLogGroupsPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of limit won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
describeLogGroups(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeLogGroupsRequest)operation.
This is a convenience which creates an instance of the
DescribeLogGroupsRequest.Builderavoiding the need to create one manually viaDescribeLogGroupsRequest.builder()- Parameters:
describeLogGroupsRequest- AConsumerthat will call methods onDescribeLogGroupsRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
describeLogStreams
default DescribeLogStreamsResponse describeLogStreams(DescribeLogStreamsRequest describeLogStreamsRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Lists the log streams for the specified log group. You can list all the log streams or filter the results by prefix. You can also control how the results are ordered.
You can specify the log group to search by using either
logGroupIdentifierorlogGroupName. You must include one of these two parameters, but you can't include both.This operation has a limit of five transactions per second, after which transactions are throttled.
If you are using CloudWatch cross-account observability, you can use this operation in a monitoring account and view data from the linked source accounts. For more information, see CloudWatch cross-account observability.
- Parameters:
describeLogStreamsRequest-- Returns:
- Result of the DescribeLogStreams operation returned by the service.
- See Also:
-
describeLogStreams
default DescribeLogStreamsResponse describeLogStreams(Consumer<DescribeLogStreamsRequest.Builder> describeLogStreamsRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Lists the log streams for the specified log group. You can list all the log streams or filter the results by prefix. You can also control how the results are ordered.
You can specify the log group to search by using either
logGroupIdentifierorlogGroupName. You must include one of these two parameters, but you can't include both.This operation has a limit of five transactions per second, after which transactions are throttled.
If you are using CloudWatch cross-account observability, you can use this operation in a monitoring account and view data from the linked source accounts. For more information, see CloudWatch cross-account observability.
This is a convenience which creates an instance of the
DescribeLogStreamsRequest.Builderavoiding the need to create one manually viaDescribeLogStreamsRequest.builder()- Parameters:
describeLogStreamsRequest- AConsumerthat will call methods onDescribeLogStreamsRequest.Builderto create a request.- Returns:
- Result of the DescribeLogStreams operation returned by the service.
- See Also:
-
describeLogStreamsPaginator
default DescribeLogStreamsIterable describeLogStreamsPaginator(DescribeLogStreamsRequest describeLogStreamsRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException This is a variant of
describeLogStreams(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeLogStreamsRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeLogStreamsIterable responses = client.describeLogStreamsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeLogStreamsIterable responses = client .describeLogStreamsPaginator(request); for (software.amazon.awssdk.services.cloudwatchlogs.model.DescribeLogStreamsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeLogStreamsIterable responses = client.describeLogStreamsPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of limit won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
describeLogStreams(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeLogStreamsRequest)operation.- Parameters:
describeLogStreamsRequest-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
describeLogStreamsPaginator
default DescribeLogStreamsIterable describeLogStreamsPaginator(Consumer<DescribeLogStreamsRequest.Builder> describeLogStreamsRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException This is a variant of
describeLogStreams(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeLogStreamsRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeLogStreamsIterable responses = client.describeLogStreamsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeLogStreamsIterable responses = client .describeLogStreamsPaginator(request); for (software.amazon.awssdk.services.cloudwatchlogs.model.DescribeLogStreamsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeLogStreamsIterable responses = client.describeLogStreamsPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of limit won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
describeLogStreams(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeLogStreamsRequest)operation.
This is a convenience which creates an instance of the
DescribeLogStreamsRequest.Builderavoiding the need to create one manually viaDescribeLogStreamsRequest.builder()- Parameters:
describeLogStreamsRequest- AConsumerthat will call methods onDescribeLogStreamsRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
describeMetricFilters
default DescribeMetricFiltersResponse describeMetricFilters(DescribeMetricFiltersRequest describeMetricFiltersRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Lists the specified metric filters. You can list all of the metric filters or filter the results by log name, prefix, metric name, or metric namespace. The results are ASCII-sorted by filter name.
- Parameters:
describeMetricFiltersRequest-- Returns:
- Result of the DescribeMetricFilters operation returned by the service.
- See Also:
-
describeMetricFilters
default DescribeMetricFiltersResponse describeMetricFilters(Consumer<DescribeMetricFiltersRequest.Builder> describeMetricFiltersRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Lists the specified metric filters. You can list all of the metric filters or filter the results by log name, prefix, metric name, or metric namespace. The results are ASCII-sorted by filter name.
This is a convenience which creates an instance of the
DescribeMetricFiltersRequest.Builderavoiding the need to create one manually viaDescribeMetricFiltersRequest.builder()- Parameters:
describeMetricFiltersRequest- AConsumerthat will call methods onDescribeMetricFiltersRequest.Builderto create a request.- Returns:
- Result of the DescribeMetricFilters operation returned by the service.
- See Also:
-
describeMetricFilters
default DescribeMetricFiltersResponse describeMetricFilters() throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsExceptionLists the specified metric filters. You can list all of the metric filters or filter the results by log name, prefix, metric name, or metric namespace. The results are ASCII-sorted by filter name.
- Returns:
- Result of the DescribeMetricFilters operation returned by the service.
- See Also:
-
describeMetricFiltersPaginator
default DescribeMetricFiltersIterable describeMetricFiltersPaginator() throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsExceptionThis is a variant of
describeMetricFilters(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeMetricFiltersRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeMetricFiltersIterable responses = client.describeMetricFiltersPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeMetricFiltersIterable responses = client .describeMetricFiltersPaginator(request); for (software.amazon.awssdk.services.cloudwatchlogs.model.DescribeMetricFiltersResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeMetricFiltersIterable responses = client.describeMetricFiltersPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of limit won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
describeMetricFilters(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeMetricFiltersRequest)operation.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
describeMetricFiltersPaginator
default DescribeMetricFiltersIterable describeMetricFiltersPaginator(DescribeMetricFiltersRequest describeMetricFiltersRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException This is a variant of
describeMetricFilters(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeMetricFiltersRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeMetricFiltersIterable responses = client.describeMetricFiltersPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeMetricFiltersIterable responses = client .describeMetricFiltersPaginator(request); for (software.amazon.awssdk.services.cloudwatchlogs.model.DescribeMetricFiltersResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeMetricFiltersIterable responses = client.describeMetricFiltersPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of limit won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
describeMetricFilters(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeMetricFiltersRequest)operation.- Parameters:
describeMetricFiltersRequest-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
describeMetricFiltersPaginator
default DescribeMetricFiltersIterable describeMetricFiltersPaginator(Consumer<DescribeMetricFiltersRequest.Builder> describeMetricFiltersRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException This is a variant of
describeMetricFilters(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeMetricFiltersRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeMetricFiltersIterable responses = client.describeMetricFiltersPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeMetricFiltersIterable responses = client .describeMetricFiltersPaginator(request); for (software.amazon.awssdk.services.cloudwatchlogs.model.DescribeMetricFiltersResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeMetricFiltersIterable responses = client.describeMetricFiltersPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of limit won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
describeMetricFilters(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeMetricFiltersRequest)operation.
This is a convenience which creates an instance of the
DescribeMetricFiltersRequest.Builderavoiding the need to create one manually viaDescribeMetricFiltersRequest.builder()- Parameters:
describeMetricFiltersRequest- AConsumerthat will call methods onDescribeMetricFiltersRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
describeQueries
default DescribeQueriesResponse describeQueries(DescribeQueriesRequest describeQueriesRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Returns a list of CloudWatch Logs Insights queries that are scheduled, running, or have been run recently in this account. You can request all queries or limit it to queries of a specific log group or queries with a certain status.
- Parameters:
describeQueriesRequest-- Returns:
- Result of the DescribeQueries operation returned by the service.
- See Also:
-
describeQueries
default DescribeQueriesResponse describeQueries(Consumer<DescribeQueriesRequest.Builder> describeQueriesRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Returns a list of CloudWatch Logs Insights queries that are scheduled, running, or have been run recently in this account. You can request all queries or limit it to queries of a specific log group or queries with a certain status.
This is a convenience which creates an instance of the
DescribeQueriesRequest.Builderavoiding the need to create one manually viaDescribeQueriesRequest.builder()- Parameters:
describeQueriesRequest- AConsumerthat will call methods onDescribeQueriesRequest.Builderto create a request.- Returns:
- Result of the DescribeQueries operation returned by the service.
- See Also:
-
describeQueries
default DescribeQueriesResponse describeQueries() throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsExceptionReturns a list of CloudWatch Logs Insights queries that are scheduled, running, or have been run recently in this account. You can request all queries or limit it to queries of a specific log group or queries with a certain status.
- Returns:
- Result of the DescribeQueries operation returned by the service.
- See Also:
-
describeQueryDefinitions
default DescribeQueryDefinitionsResponse describeQueryDefinitions(DescribeQueryDefinitionsRequest describeQueryDefinitionsRequest) throws InvalidParameterException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException This operation returns a paginated list of your saved CloudWatch Logs Insights query definitions. You can retrieve query definitions from the current account or from a source account that is linked to the current account.
You can use the
queryDefinitionNamePrefixparameter to limit the results to only the query definitions that have names that start with a certain string.- Parameters:
describeQueryDefinitionsRequest-- Returns:
- Result of the DescribeQueryDefinitions operation returned by the service.
- See Also:
-
describeQueryDefinitions
default DescribeQueryDefinitionsResponse describeQueryDefinitions(Consumer<DescribeQueryDefinitionsRequest.Builder> describeQueryDefinitionsRequest) throws InvalidParameterException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException This operation returns a paginated list of your saved CloudWatch Logs Insights query definitions. You can retrieve query definitions from the current account or from a source account that is linked to the current account.
You can use the
queryDefinitionNamePrefixparameter to limit the results to only the query definitions that have names that start with a certain string.
This is a convenience which creates an instance of the
DescribeQueryDefinitionsRequest.Builderavoiding the need to create one manually viaDescribeQueryDefinitionsRequest.builder()- Parameters:
describeQueryDefinitionsRequest- AConsumerthat will call methods onDescribeQueryDefinitionsRequest.Builderto create a request.- Returns:
- Result of the DescribeQueryDefinitions operation returned by the service.
- See Also:
-
describeResourcePolicies
default DescribeResourcePoliciesResponse describeResourcePolicies(DescribeResourcePoliciesRequest describeResourcePoliciesRequest) throws InvalidParameterException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Lists the resource policies in this account.
- Parameters:
describeResourcePoliciesRequest-- Returns:
- Result of the DescribeResourcePolicies operation returned by the service.
- See Also:
-
describeResourcePolicies
default DescribeResourcePoliciesResponse describeResourcePolicies(Consumer<DescribeResourcePoliciesRequest.Builder> describeResourcePoliciesRequest) throws InvalidParameterException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Lists the resource policies in this account.
This is a convenience which creates an instance of the
DescribeResourcePoliciesRequest.Builderavoiding the need to create one manually viaDescribeResourcePoliciesRequest.builder()- Parameters:
describeResourcePoliciesRequest- AConsumerthat will call methods onDescribeResourcePoliciesRequest.Builderto create a request.- Returns:
- Result of the DescribeResourcePolicies operation returned by the service.
- See Also:
-
describeResourcePolicies
default DescribeResourcePoliciesResponse describeResourcePolicies() throws InvalidParameterException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsExceptionLists the resource policies in this account.
- Returns:
- Result of the DescribeResourcePolicies operation returned by the service.
- See Also:
-
describeSubscriptionFilters
default DescribeSubscriptionFiltersResponse describeSubscriptionFilters(DescribeSubscriptionFiltersRequest describeSubscriptionFiltersRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Lists the subscription filters for the specified log group. You can list all the subscription filters or filter the results by prefix. The results are ASCII-sorted by filter name.
- Parameters:
describeSubscriptionFiltersRequest-- Returns:
- Result of the DescribeSubscriptionFilters operation returned by the service.
- See Also:
-
describeSubscriptionFilters
default DescribeSubscriptionFiltersResponse describeSubscriptionFilters(Consumer<DescribeSubscriptionFiltersRequest.Builder> describeSubscriptionFiltersRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Lists the subscription filters for the specified log group. You can list all the subscription filters or filter the results by prefix. The results are ASCII-sorted by filter name.
This is a convenience which creates an instance of the
DescribeSubscriptionFiltersRequest.Builderavoiding the need to create one manually viaDescribeSubscriptionFiltersRequest.builder()- Parameters:
describeSubscriptionFiltersRequest- AConsumerthat will call methods onDescribeSubscriptionFiltersRequest.Builderto create a request.- Returns:
- Result of the DescribeSubscriptionFilters operation returned by the service.
- See Also:
-
describeSubscriptionFiltersPaginator
default DescribeSubscriptionFiltersIterable describeSubscriptionFiltersPaginator(DescribeSubscriptionFiltersRequest describeSubscriptionFiltersRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException This is a variant of
describeSubscriptionFilters(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeSubscriptionFiltersRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeSubscriptionFiltersIterable responses = client.describeSubscriptionFiltersPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeSubscriptionFiltersIterable responses = client .describeSubscriptionFiltersPaginator(request); for (software.amazon.awssdk.services.cloudwatchlogs.model.DescribeSubscriptionFiltersResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeSubscriptionFiltersIterable responses = client.describeSubscriptionFiltersPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of limit won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
describeSubscriptionFilters(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeSubscriptionFiltersRequest)operation.- Parameters:
describeSubscriptionFiltersRequest-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
describeSubscriptionFiltersPaginator
default DescribeSubscriptionFiltersIterable describeSubscriptionFiltersPaginator(Consumer<DescribeSubscriptionFiltersRequest.Builder> describeSubscriptionFiltersRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException This is a variant of
describeSubscriptionFilters(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeSubscriptionFiltersRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeSubscriptionFiltersIterable responses = client.describeSubscriptionFiltersPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeSubscriptionFiltersIterable responses = client .describeSubscriptionFiltersPaginator(request); for (software.amazon.awssdk.services.cloudwatchlogs.model.DescribeSubscriptionFiltersResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.cloudwatchlogs.paginators.DescribeSubscriptionFiltersIterable responses = client.describeSubscriptionFiltersPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of limit won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
describeSubscriptionFilters(software.amazon.awssdk.services.cloudwatchlogs.model.DescribeSubscriptionFiltersRequest)operation.
This is a convenience which creates an instance of the
DescribeSubscriptionFiltersRequest.Builderavoiding the need to create one manually viaDescribeSubscriptionFiltersRequest.builder()- Parameters:
describeSubscriptionFiltersRequest- AConsumerthat will call methods onDescribeSubscriptionFiltersRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
disassociateKmsKey
default DisassociateKmsKeyResponse disassociateKmsKey(DisassociateKmsKeyRequest disassociateKmsKeyRequest) throws InvalidParameterException, ResourceNotFoundException, OperationAbortedException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Disassociates the specified KMS key from the specified log group or from all CloudWatch Logs Insights query results in the account.
When you use
DisassociateKmsKey, you specify either thelogGroupNameparameter or theresourceIdentifierparameter. You can't specify both of those parameters in the same operation.-
Specify the
logGroupNameparameter to stop using the KMS key to encrypt future log events ingested and stored in the log group. Instead, they will be encrypted with the default CloudWatch Logs method. The log events that were ingested while the key was associated with the log group are still encrypted with that key. Therefore, CloudWatch Logs will need permissions for the key whenever that data is accessed. -
Specify the
resourceIdentifierparameter with thequery-resultresource to stop using the KMS key to encrypt the results of all future StartQuery operations in the account. They will instead be encrypted with the default CloudWatch Logs method. The results from queries that ran while the key was associated with the account are still encrypted with that key. Therefore, CloudWatch Logs will need permissions for the key whenever that data is accessed.
It can take up to 5 minutes for this operation to take effect.
- Parameters:
disassociateKmsKeyRequest-- Returns:
- Result of the DisassociateKmsKey operation returned by the service.
- See Also:
-
-
disassociateKmsKey
default DisassociateKmsKeyResponse disassociateKmsKey(Consumer<DisassociateKmsKeyRequest.Builder> disassociateKmsKeyRequest) throws InvalidParameterException, ResourceNotFoundException, OperationAbortedException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Disassociates the specified KMS key from the specified log group or from all CloudWatch Logs Insights query results in the account.
When you use
DisassociateKmsKey, you specify either thelogGroupNameparameter or theresourceIdentifierparameter. You can't specify both of those parameters in the same operation.-
Specify the
logGroupNameparameter to stop using the KMS key to encrypt future log events ingested and stored in the log group. Instead, they will be encrypted with the default CloudWatch Logs method. The log events that were ingested while the key was associated with the log group are still encrypted with that key. Therefore, CloudWatch Logs will need permissions for the key whenever that data is accessed. -
Specify the
resourceIdentifierparameter with thequery-resultresource to stop using the KMS key to encrypt the results of all future StartQuery operations in the account. They will instead be encrypted with the default CloudWatch Logs method. The results from queries that ran while the key was associated with the account are still encrypted with that key. Therefore, CloudWatch Logs will need permissions for the key whenever that data is accessed.
It can take up to 5 minutes for this operation to take effect.
This is a convenience which creates an instance of the
DisassociateKmsKeyRequest.Builderavoiding the need to create one manually viaDisassociateKmsKeyRequest.builder()- Parameters:
disassociateKmsKeyRequest- AConsumerthat will call methods onDisassociateKmsKeyRequest.Builderto create a request.- Returns:
- Result of the DisassociateKmsKey operation returned by the service.
- See Also:
-
-
filterLogEvents
default FilterLogEventsResponse filterLogEvents(FilterLogEventsRequest filterLogEventsRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Lists log events from the specified log group. You can list all the log events or filter the results using a filter pattern, a time range, and the name of the log stream.
You must have the
logs:FilterLogEventspermission to perform this operation.You can specify the log group to search by using either
logGroupIdentifierorlogGroupName. You must include one of these two parameters, but you can't include both.By default, this operation returns as many log events as can fit in 1 MB (up to 10,000 log events) or all the events found within the specified time range. If the results include a token, that means there are more log events available. You can get additional results by specifying the token in a subsequent call. This operation can return empty results while there are more log events available through the token.
The returned log events are sorted by event timestamp, the timestamp when the event was ingested by CloudWatch Logs, and the ID of the
PutLogEventsrequest.If you are using CloudWatch cross-account observability, you can use this operation in a monitoring account and view data from the linked source accounts. For more information, see CloudWatch cross-account observability.
- Parameters:
filterLogEventsRequest-- Returns:
- Result of the FilterLogEvents operation returned by the service.
- See Also:
-
filterLogEvents
default FilterLogEventsResponse filterLogEvents(Consumer<FilterLogEventsRequest.Builder> filterLogEventsRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Lists log events from the specified log group. You can list all the log events or filter the results using a filter pattern, a time range, and the name of the log stream.
You must have the
logs:FilterLogEventspermission to perform this operation.You can specify the log group to search by using either
logGroupIdentifierorlogGroupName. You must include one of these two parameters, but you can't include both.By default, this operation returns as many log events as can fit in 1 MB (up to 10,000 log events) or all the events found within the specified time range. If the results include a token, that means there are more log events available. You can get additional results by specifying the token in a subsequent call. This operation can return empty results while there are more log events available through the token.
The returned log events are sorted by event timestamp, the timestamp when the event was ingested by CloudWatch Logs, and the ID of the
PutLogEventsrequest.If you are using CloudWatch cross-account observability, you can use this operation in a monitoring account and view data from the linked source accounts. For more information, see CloudWatch cross-account observability.
This is a convenience which creates an instance of the
FilterLogEventsRequest.Builderavoiding the need to create one manually viaFilterLogEventsRequest.builder()- Parameters:
filterLogEventsRequest- AConsumerthat will call methods onFilterLogEventsRequest.Builderto create a request.- Returns:
- Result of the FilterLogEvents operation returned by the service.
- See Also:
-
filterLogEventsPaginator
default FilterLogEventsIterable filterLogEventsPaginator(FilterLogEventsRequest filterLogEventsRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException This is a variant of
filterLogEvents(software.amazon.awssdk.services.cloudwatchlogs.model.FilterLogEventsRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.cloudwatchlogs.paginators.FilterLogEventsIterable responses = client.filterLogEventsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.cloudwatchlogs.paginators.FilterLogEventsIterable responses = client .filterLogEventsPaginator(request); for (software.amazon.awssdk.services.cloudwatchlogs.model.FilterLogEventsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.cloudwatchlogs.paginators.FilterLogEventsIterable responses = client.filterLogEventsPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of limit won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
filterLogEvents(software.amazon.awssdk.services.cloudwatchlogs.model.FilterLogEventsRequest)operation.- Parameters:
filterLogEventsRequest-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
filterLogEventsPaginator
default FilterLogEventsIterable filterLogEventsPaginator(Consumer<FilterLogEventsRequest.Builder> filterLogEventsRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException This is a variant of
filterLogEvents(software.amazon.awssdk.services.cloudwatchlogs.model.FilterLogEventsRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.cloudwatchlogs.paginators.FilterLogEventsIterable responses = client.filterLogEventsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.cloudwatchlogs.paginators.FilterLogEventsIterable responses = client .filterLogEventsPaginator(request); for (software.amazon.awssdk.services.cloudwatchlogs.model.FilterLogEventsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.cloudwatchlogs.paginators.FilterLogEventsIterable responses = client.filterLogEventsPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of limit won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
filterLogEvents(software.amazon.awssdk.services.cloudwatchlogs.model.FilterLogEventsRequest)operation.
This is a convenience which creates an instance of the
FilterLogEventsRequest.Builderavoiding the need to create one manually viaFilterLogEventsRequest.builder()- Parameters:
filterLogEventsRequest- AConsumerthat will call methods onFilterLogEventsRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
getDataProtectionPolicy
default GetDataProtectionPolicyResponse getDataProtectionPolicy(GetDataProtectionPolicyRequest getDataProtectionPolicyRequest) throws InvalidParameterException, OperationAbortedException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Returns information about a log group data protection policy.
- Parameters:
getDataProtectionPolicyRequest-- Returns:
- Result of the GetDataProtectionPolicy operation returned by the service.
- See Also:
-
getDataProtectionPolicy
default GetDataProtectionPolicyResponse getDataProtectionPolicy(Consumer<GetDataProtectionPolicyRequest.Builder> getDataProtectionPolicyRequest) throws InvalidParameterException, OperationAbortedException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Returns information about a log group data protection policy.
This is a convenience which creates an instance of the
GetDataProtectionPolicyRequest.Builderavoiding the need to create one manually viaGetDataProtectionPolicyRequest.builder()- Parameters:
getDataProtectionPolicyRequest- AConsumerthat will call methods onGetDataProtectionPolicyRequest.Builderto create a request.- Returns:
- Result of the GetDataProtectionPolicy operation returned by the service.
- See Also:
-
getDelivery
default GetDeliveryResponse getDelivery(GetDeliveryRequest getDeliveryRequest) throws ResourceNotFoundException, ServiceUnavailableException, ValidationException, ServiceQuotaExceededException, ThrottlingException, AwsServiceException, SdkClientException, CloudWatchLogsException Returns complete information about one logical delivery. A delivery is a connection between a delivery source and a delivery destination .
A delivery source represents an Amazon Web Services resource that sends logs to an logs delivery destination. The destination can be CloudWatch Logs, Amazon S3, or Firehose. Only some Amazon Web Services services support being configured as a delivery source. These services are listed in Enable logging from Amazon Web Services services.
You need to specify the delivery
idin this operation. You can find the IDs of the deliveries in your account with the DescribeDeliveries operation.- Parameters:
getDeliveryRequest-- Returns:
- Result of the GetDelivery operation returned by the service.
- See Also:
-
getDelivery
default GetDeliveryResponse getDelivery(Consumer<GetDeliveryRequest.Builder> getDeliveryRequest) throws ResourceNotFoundException, ServiceUnavailableException, ValidationException, ServiceQuotaExceededException, ThrottlingException, AwsServiceException, SdkClientException, CloudWatchLogsException Returns complete information about one logical delivery. A delivery is a connection between a delivery source and a delivery destination .
A delivery source represents an Amazon Web Services resource that sends logs to an logs delivery destination. The destination can be CloudWatch Logs, Amazon S3, or Firehose. Only some Amazon Web Services services support being configured as a delivery source. These services are listed in Enable logging from Amazon Web Services services.
You need to specify the delivery
idin this operation. You can find the IDs of the deliveries in your account with the DescribeDeliveries operation.
This is a convenience which creates an instance of the
GetDeliveryRequest.Builderavoiding the need to create one manually viaGetDeliveryRequest.builder()- Parameters:
getDeliveryRequest- AConsumerthat will call methods onGetDeliveryRequest.Builderto create a request.- Returns:
- Result of the GetDelivery operation returned by the service.
- See Also:
-
getDeliveryDestination
default GetDeliveryDestinationResponse getDeliveryDestination(GetDeliveryDestinationRequest getDeliveryDestinationRequest) throws ResourceNotFoundException, ServiceUnavailableException, ValidationException, ServiceQuotaExceededException, ThrottlingException, AwsServiceException, SdkClientException, CloudWatchLogsException Retrieves complete information about one delivery destination.
- Parameters:
getDeliveryDestinationRequest-- Returns:
- Result of the GetDeliveryDestination operation returned by the service.
- See Also:
-
getDeliveryDestination
default GetDeliveryDestinationResponse getDeliveryDestination(Consumer<GetDeliveryDestinationRequest.Builder> getDeliveryDestinationRequest) throws ResourceNotFoundException, ServiceUnavailableException, ValidationException, ServiceQuotaExceededException, ThrottlingException, AwsServiceException, SdkClientException, CloudWatchLogsException Retrieves complete information about one delivery destination.
This is a convenience which creates an instance of the
GetDeliveryDestinationRequest.Builderavoiding the need to create one manually viaGetDeliveryDestinationRequest.builder()- Parameters:
getDeliveryDestinationRequest- AConsumerthat will call methods onGetDeliveryDestinationRequest.Builderto create a request.- Returns:
- Result of the GetDeliveryDestination operation returned by the service.
- See Also:
-
getDeliveryDestinationPolicy
default GetDeliveryDestinationPolicyResponse getDeliveryDestinationPolicy(GetDeliveryDestinationPolicyRequest getDeliveryDestinationPolicyRequest) throws ServiceUnavailableException, ValidationException, ResourceNotFoundException, AwsServiceException, SdkClientException, CloudWatchLogsException Retrieves the delivery destination policy assigned to the delivery destination that you specify. For more information about delivery destinations and their policies, see PutDeliveryDestinationPolicy.
- Parameters:
getDeliveryDestinationPolicyRequest-- Returns:
- Result of the GetDeliveryDestinationPolicy operation returned by the service.
- See Also:
-
getDeliveryDestinationPolicy
default GetDeliveryDestinationPolicyResponse getDeliveryDestinationPolicy(Consumer<GetDeliveryDestinationPolicyRequest.Builder> getDeliveryDestinationPolicyRequest) throws ServiceUnavailableException, ValidationException, ResourceNotFoundException, AwsServiceException, SdkClientException, CloudWatchLogsException Retrieves the delivery destination policy assigned to the delivery destination that you specify. For more information about delivery destinations and their policies, see PutDeliveryDestinationPolicy.
This is a convenience which creates an instance of the
GetDeliveryDestinationPolicyRequest.Builderavoiding the need to create one manually viaGetDeliveryDestinationPolicyRequest.builder()- Parameters:
getDeliveryDestinationPolicyRequest- AConsumerthat will call methods onGetDeliveryDestinationPolicyRequest.Builderto create a request.- Returns:
- Result of the GetDeliveryDestinationPolicy operation returned by the service.
- See Also:
-
getDeliverySource
default GetDeliverySourceResponse getDeliverySource(GetDeliverySourceRequest getDeliverySourceRequest) throws ResourceNotFoundException, ServiceUnavailableException, ValidationException, ServiceQuotaExceededException, ThrottlingException, AwsServiceException, SdkClientException, CloudWatchLogsException Retrieves complete information about one delivery source.
- Parameters:
getDeliverySourceRequest-- Returns:
- Result of the GetDeliverySource operation returned by the service.
- See Also:
-
getDeliverySource
default GetDeliverySourceResponse getDeliverySource(Consumer<GetDeliverySourceRequest.Builder> getDeliverySourceRequest) throws ResourceNotFoundException, ServiceUnavailableException, ValidationException, ServiceQuotaExceededException, ThrottlingException, AwsServiceException, SdkClientException, CloudWatchLogsException Retrieves complete information about one delivery source.
This is a convenience which creates an instance of the
GetDeliverySourceRequest.Builderavoiding the need to create one manually viaGetDeliverySourceRequest.builder()- Parameters:
getDeliverySourceRequest- AConsumerthat will call methods onGetDeliverySourceRequest.Builderto create a request.- Returns:
- Result of the GetDeliverySource operation returned by the service.
- See Also:
-
getLogAnomalyDetector
default GetLogAnomalyDetectorResponse getLogAnomalyDetector(GetLogAnomalyDetectorRequest getLogAnomalyDetectorRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, OperationAbortedException, AwsServiceException, SdkClientException, CloudWatchLogsException Retrieves information about the log anomaly detector that you specify.
- Parameters:
getLogAnomalyDetectorRequest-- Returns:
- Result of the GetLogAnomalyDetector operation returned by the service.
- See Also:
-
getLogAnomalyDetector
default GetLogAnomalyDetectorResponse getLogAnomalyDetector(Consumer<GetLogAnomalyDetectorRequest.Builder> getLogAnomalyDetectorRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, OperationAbortedException, AwsServiceException, SdkClientException, CloudWatchLogsException Retrieves information about the log anomaly detector that you specify.
This is a convenience which creates an instance of the
GetLogAnomalyDetectorRequest.Builderavoiding the need to create one manually viaGetLogAnomalyDetectorRequest.builder()- Parameters:
getLogAnomalyDetectorRequest- AConsumerthat will call methods onGetLogAnomalyDetectorRequest.Builderto create a request.- Returns:
- Result of the GetLogAnomalyDetector operation returned by the service.
- See Also:
-
getLogEvents
default GetLogEventsResponse getLogEvents(GetLogEventsRequest getLogEventsRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Lists log events from the specified log stream. You can list all of the log events or filter using a time range.
By default, this operation returns as many log events as can fit in a response size of 1MB (up to 10,000 log events). You can get additional log events by specifying one of the tokens in a subsequent call. This operation can return empty results while there are more log events available through the token.
If you are using CloudWatch cross-account observability, you can use this operation in a monitoring account and view data from the linked source accounts. For more information, see CloudWatch cross-account observability.
You can specify the log group to search by using either
logGroupIdentifierorlogGroupName. You must include one of these two parameters, but you can't include both.- Parameters:
getLogEventsRequest-- Returns:
- Result of the GetLogEvents operation returned by the service.
- See Also:
-
getLogEvents
default GetLogEventsResponse getLogEvents(Consumer<GetLogEventsRequest.Builder> getLogEventsRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Lists log events from the specified log stream. You can list all of the log events or filter using a time range.
By default, this operation returns as many log events as can fit in a response size of 1MB (up to 10,000 log events). You can get additional log events by specifying one of the tokens in a subsequent call. This operation can return empty results while there are more log events available through the token.
If you are using CloudWatch cross-account observability, you can use this operation in a monitoring account and view data from the linked source accounts. For more information, see CloudWatch cross-account observability.
You can specify the log group to search by using either
logGroupIdentifierorlogGroupName. You must include one of these two parameters, but you can't include both.
This is a convenience which creates an instance of the
GetLogEventsRequest.Builderavoiding the need to create one manually viaGetLogEventsRequest.builder()- Parameters:
getLogEventsRequest- AConsumerthat will call methods onGetLogEventsRequest.Builderto create a request.- Returns:
- Result of the GetLogEvents operation returned by the service.
- See Also:
-
getLogEventsPaginator
default GetLogEventsIterable getLogEventsPaginator(GetLogEventsRequest getLogEventsRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException This is a variant of
getLogEvents(software.amazon.awssdk.services.cloudwatchlogs.model.GetLogEventsRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.cloudwatchlogs.paginators.GetLogEventsIterable responses = client.getLogEventsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.cloudwatchlogs.paginators.GetLogEventsIterable responses = client .getLogEventsPaginator(request); for (software.amazon.awssdk.services.cloudwatchlogs.model.GetLogEventsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.cloudwatchlogs.paginators.GetLogEventsIterable responses = client.getLogEventsPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of limit won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
getLogEvents(software.amazon.awssdk.services.cloudwatchlogs.model.GetLogEventsRequest)operation.- Parameters:
getLogEventsRequest-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
getLogEventsPaginator
default GetLogEventsIterable getLogEventsPaginator(Consumer<GetLogEventsRequest.Builder> getLogEventsRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException This is a variant of
getLogEvents(software.amazon.awssdk.services.cloudwatchlogs.model.GetLogEventsRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.cloudwatchlogs.paginators.GetLogEventsIterable responses = client.getLogEventsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.cloudwatchlogs.paginators.GetLogEventsIterable responses = client .getLogEventsPaginator(request); for (software.amazon.awssdk.services.cloudwatchlogs.model.GetLogEventsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.cloudwatchlogs.paginators.GetLogEventsIterable responses = client.getLogEventsPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of limit won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
getLogEvents(software.amazon.awssdk.services.cloudwatchlogs.model.GetLogEventsRequest)operation.
This is a convenience which creates an instance of the
GetLogEventsRequest.Builderavoiding the need to create one manually viaGetLogEventsRequest.builder()- Parameters:
getLogEventsRequest- AConsumerthat will call methods onGetLogEventsRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
getLogGroupFields
default GetLogGroupFieldsResponse getLogGroupFields(GetLogGroupFieldsRequest getLogGroupFieldsRequest) throws InvalidParameterException, LimitExceededException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Returns a list of the fields that are included in log events in the specified log group. Includes the percentage of log events that contain each field. The search is limited to a time period that you specify.
You can specify the log group to search by using either
logGroupIdentifierorlogGroupName. You must specify one of these parameters, but you can't specify both.In the results, fields that start with
@are fields generated by CloudWatch Logs. For example,@timestampis the timestamp of each log event. For more information about the fields that are generated by CloudWatch logs, see Supported Logs and Discovered Fields.The response results are sorted by the frequency percentage, starting with the highest percentage.
If you are using CloudWatch cross-account observability, you can use this operation in a monitoring account and view data from the linked source accounts. For more information, see CloudWatch cross-account observability.
- Parameters:
getLogGroupFieldsRequest-- Returns:
- Result of the GetLogGroupFields operation returned by the service.
- See Also:
-
getLogGroupFields
default GetLogGroupFieldsResponse getLogGroupFields(Consumer<GetLogGroupFieldsRequest.Builder> getLogGroupFieldsRequest) throws InvalidParameterException, LimitExceededException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Returns a list of the fields that are included in log events in the specified log group. Includes the percentage of log events that contain each field. The search is limited to a time period that you specify.
You can specify the log group to search by using either
logGroupIdentifierorlogGroupName. You must specify one of these parameters, but you can't specify both.In the results, fields that start with
@are fields generated by CloudWatch Logs. For example,@timestampis the timestamp of each log event. For more information about the fields that are generated by CloudWatch logs, see Supported Logs and Discovered Fields.The response results are sorted by the frequency percentage, starting with the highest percentage.
If you are using CloudWatch cross-account observability, you can use this operation in a monitoring account and view data from the linked source accounts. For more information, see CloudWatch cross-account observability.
This is a convenience which creates an instance of the
GetLogGroupFieldsRequest.Builderavoiding the need to create one manually viaGetLogGroupFieldsRequest.builder()- Parameters:
getLogGroupFieldsRequest- AConsumerthat will call methods onGetLogGroupFieldsRequest.Builderto create a request.- Returns:
- Result of the GetLogGroupFields operation returned by the service.
- See Also:
-
getLogRecord
default GetLogRecordResponse getLogRecord(GetLogRecordRequest getLogRecordRequest) throws InvalidParameterException, LimitExceededException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Retrieves all of the fields and values of a single log event. All fields are retrieved, even if the original query that produced the
logRecordPointerretrieved only a subset of fields. Fields are returned as field name/field value pairs.The full unparsed log event is returned within
@message.- Parameters:
getLogRecordRequest-- Returns:
- Result of the GetLogRecord operation returned by the service.
- See Also:
-
getLogRecord
default GetLogRecordResponse getLogRecord(Consumer<GetLogRecordRequest.Builder> getLogRecordRequest) throws InvalidParameterException, LimitExceededException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Retrieves all of the fields and values of a single log event. All fields are retrieved, even if the original query that produced the
logRecordPointerretrieved only a subset of fields. Fields are returned as field name/field value pairs.The full unparsed log event is returned within
@message.
This is a convenience which creates an instance of the
GetLogRecordRequest.Builderavoiding the need to create one manually viaGetLogRecordRequest.builder()- Parameters:
getLogRecordRequest- AConsumerthat will call methods onGetLogRecordRequest.Builderto create a request.- Returns:
- Result of the GetLogRecord operation returned by the service.
- See Also:
-
getQueryResults
default GetQueryResultsResponse getQueryResults(GetQueryResultsRequest getQueryResultsRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Returns the results from the specified query.
Only the fields requested in the query are returned, along with a
@ptrfield, which is the identifier for the log record. You can use the value of@ptrin a GetLogRecord operation to get the full log record.GetQueryResultsdoes not start running a query. To run a query, use StartQuery. For more information about how long results of previous queries are available, see CloudWatch Logs quotas.If the value of the
Statusfield in the output isRunning, this operation returns only partial results. If you see a value ofScheduledorRunningfor the status, you can retry the operation later to see the final results.If you are using CloudWatch cross-account observability, you can use this operation in a monitoring account to start queries in linked source accounts. For more information, see CloudWatch cross-account observability.
- Parameters:
getQueryResultsRequest-- Returns:
- Result of the GetQueryResults operation returned by the service.
- See Also:
-
getQueryResults
default GetQueryResultsResponse getQueryResults(Consumer<GetQueryResultsRequest.Builder> getQueryResultsRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Returns the results from the specified query.
Only the fields requested in the query are returned, along with a
@ptrfield, which is the identifier for the log record. You can use the value of@ptrin a GetLogRecord operation to get the full log record.GetQueryResultsdoes not start running a query. To run a query, use StartQuery. For more information about how long results of previous queries are available, see CloudWatch Logs quotas.If the value of the
Statusfield in the output isRunning, this operation returns only partial results. If you see a value ofScheduledorRunningfor the status, you can retry the operation later to see the final results.If you are using CloudWatch cross-account observability, you can use this operation in a monitoring account to start queries in linked source accounts. For more information, see CloudWatch cross-account observability.
This is a convenience which creates an instance of the
GetQueryResultsRequest.Builderavoiding the need to create one manually viaGetQueryResultsRequest.builder()- Parameters:
getQueryResultsRequest- AConsumerthat will call methods onGetQueryResultsRequest.Builderto create a request.- Returns:
- Result of the GetQueryResults operation returned by the service.
- See Also:
-
listAnomalies
default ListAnomaliesResponse listAnomalies(ListAnomaliesRequest listAnomaliesRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, OperationAbortedException, AwsServiceException, SdkClientException, CloudWatchLogsException Returns a list of anomalies that log anomaly detectors have found. For details about the structure format of each anomaly object that is returned, see the example in this section.
- Parameters:
listAnomaliesRequest-- Returns:
- Result of the ListAnomalies operation returned by the service.
- See Also:
-
listAnomalies
default ListAnomaliesResponse listAnomalies(Consumer<ListAnomaliesRequest.Builder> listAnomaliesRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, OperationAbortedException, AwsServiceException, SdkClientException, CloudWatchLogsException Returns a list of anomalies that log anomaly detectors have found. For details about the structure format of each anomaly object that is returned, see the example in this section.
This is a convenience which creates an instance of the
ListAnomaliesRequest.Builderavoiding the need to create one manually viaListAnomaliesRequest.builder()- Parameters:
listAnomaliesRequest- AConsumerthat will call methods onListAnomaliesRequest.Builderto create a request.- Returns:
- Result of the ListAnomalies operation returned by the service.
- See Also:
-
listAnomaliesPaginator
default ListAnomaliesIterable listAnomaliesPaginator(ListAnomaliesRequest listAnomaliesRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, OperationAbortedException, AwsServiceException, SdkClientException, CloudWatchLogsException This is a variant of
listAnomalies(software.amazon.awssdk.services.cloudwatchlogs.model.ListAnomaliesRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.cloudwatchlogs.paginators.ListAnomaliesIterable responses = client.listAnomaliesPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.cloudwatchlogs.paginators.ListAnomaliesIterable responses = client .listAnomaliesPaginator(request); for (software.amazon.awssdk.services.cloudwatchlogs.model.ListAnomaliesResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.cloudwatchlogs.paginators.ListAnomaliesIterable responses = client.listAnomaliesPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of limit won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listAnomalies(software.amazon.awssdk.services.cloudwatchlogs.model.ListAnomaliesRequest)operation.- Parameters:
listAnomaliesRequest-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
listAnomaliesPaginator
default ListAnomaliesIterable listAnomaliesPaginator(Consumer<ListAnomaliesRequest.Builder> listAnomaliesRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, OperationAbortedException, AwsServiceException, SdkClientException, CloudWatchLogsException This is a variant of
listAnomalies(software.amazon.awssdk.services.cloudwatchlogs.model.ListAnomaliesRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.cloudwatchlogs.paginators.ListAnomaliesIterable responses = client.listAnomaliesPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.cloudwatchlogs.paginators.ListAnomaliesIterable responses = client .listAnomaliesPaginator(request); for (software.amazon.awssdk.services.cloudwatchlogs.model.ListAnomaliesResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.cloudwatchlogs.paginators.ListAnomaliesIterable responses = client.listAnomaliesPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of limit won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listAnomalies(software.amazon.awssdk.services.cloudwatchlogs.model.ListAnomaliesRequest)operation.
This is a convenience which creates an instance of the
ListAnomaliesRequest.Builderavoiding the need to create one manually viaListAnomaliesRequest.builder()- Parameters:
listAnomaliesRequest- AConsumerthat will call methods onListAnomaliesRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
listLogAnomalyDetectors
default ListLogAnomalyDetectorsResponse listLogAnomalyDetectors(ListLogAnomalyDetectorsRequest listLogAnomalyDetectorsRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, OperationAbortedException, AwsServiceException, SdkClientException, CloudWatchLogsException Retrieves a list of the log anomaly detectors in the account.
- Parameters:
listLogAnomalyDetectorsRequest-- Returns:
- Result of the ListLogAnomalyDetectors operation returned by the service.
- See Also:
-
listLogAnomalyDetectors
default ListLogAnomalyDetectorsResponse listLogAnomalyDetectors(Consumer<ListLogAnomalyDetectorsRequest.Builder> listLogAnomalyDetectorsRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, OperationAbortedException, AwsServiceException, SdkClientException, CloudWatchLogsException Retrieves a list of the log anomaly detectors in the account.
This is a convenience which creates an instance of the
ListLogAnomalyDetectorsRequest.Builderavoiding the need to create one manually viaListLogAnomalyDetectorsRequest.builder()- Parameters:
listLogAnomalyDetectorsRequest- AConsumerthat will call methods onListLogAnomalyDetectorsRequest.Builderto create a request.- Returns:
- Result of the ListLogAnomalyDetectors operation returned by the service.
- See Also:
-
listLogAnomalyDetectorsPaginator
default ListLogAnomalyDetectorsIterable listLogAnomalyDetectorsPaginator(ListLogAnomalyDetectorsRequest listLogAnomalyDetectorsRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, OperationAbortedException, AwsServiceException, SdkClientException, CloudWatchLogsException This is a variant of
listLogAnomalyDetectors(software.amazon.awssdk.services.cloudwatchlogs.model.ListLogAnomalyDetectorsRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.cloudwatchlogs.paginators.ListLogAnomalyDetectorsIterable responses = client.listLogAnomalyDetectorsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.cloudwatchlogs.paginators.ListLogAnomalyDetectorsIterable responses = client .listLogAnomalyDetectorsPaginator(request); for (software.amazon.awssdk.services.cloudwatchlogs.model.ListLogAnomalyDetectorsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.cloudwatchlogs.paginators.ListLogAnomalyDetectorsIterable responses = client.listLogAnomalyDetectorsPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of limit won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listLogAnomalyDetectors(software.amazon.awssdk.services.cloudwatchlogs.model.ListLogAnomalyDetectorsRequest)operation.- Parameters:
listLogAnomalyDetectorsRequest-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
listLogAnomalyDetectorsPaginator
default ListLogAnomalyDetectorsIterable listLogAnomalyDetectorsPaginator(Consumer<ListLogAnomalyDetectorsRequest.Builder> listLogAnomalyDetectorsRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, OperationAbortedException, AwsServiceException, SdkClientException, CloudWatchLogsException This is a variant of
listLogAnomalyDetectors(software.amazon.awssdk.services.cloudwatchlogs.model.ListLogAnomalyDetectorsRequest)operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Stream
2) Using For loopsoftware.amazon.awssdk.services.cloudwatchlogs.paginators.ListLogAnomalyDetectorsIterable responses = client.listLogAnomalyDetectorsPaginator(request); responses.stream().forEach(....);{ @code software.amazon.awssdk.services.cloudwatchlogs.paginators.ListLogAnomalyDetectorsIterable responses = client .listLogAnomalyDetectorsPaginator(request); for (software.amazon.awssdk.services.cloudwatchlogs.model.ListLogAnomalyDetectorsResponse response : responses) { // do something; } }3) Use iterator directlysoftware.amazon.awssdk.services.cloudwatchlogs.paginators.ListLogAnomalyDetectorsIterable responses = client.listLogAnomalyDetectorsPaginator(request); responses.iterator().forEachRemaining(....);Please notice that the configuration of limit won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listLogAnomalyDetectors(software.amazon.awssdk.services.cloudwatchlogs.model.ListLogAnomalyDetectorsRequest)operation.
This is a convenience which creates an instance of the
ListLogAnomalyDetectorsRequest.Builderavoiding the need to create one manually viaListLogAnomalyDetectorsRequest.builder()- Parameters:
listLogAnomalyDetectorsRequest- AConsumerthat will call methods onListLogAnomalyDetectorsRequest.Builderto create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
listTagsForResource
default ListTagsForResourceResponse listTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Displays the tags associated with a CloudWatch Logs resource. Currently, log groups and destinations support tagging.
- Parameters:
listTagsForResourceRequest-- Returns:
- Result of the ListTagsForResource operation returned by the service.
- See Also:
-
listTagsForResource
default ListTagsForResourceResponse listTagsForResource(Consumer<ListTagsForResourceRequest.Builder> listTagsForResourceRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Displays the tags associated with a CloudWatch Logs resource. Currently, log groups and destinations support tagging.
This is a convenience which creates an instance of the
ListTagsForResourceRequest.Builderavoiding the need to create one manually viaListTagsForResourceRequest.builder()- Parameters:
listTagsForResourceRequest- AConsumerthat will call methods onListTagsForResourceRequest.Builderto create a request.- Returns:
- Result of the ListTagsForResource operation returned by the service.
- See Also:
-
listTagsLogGroup
@Deprecated default ListTagsLogGroupResponse listTagsLogGroup(ListTagsLogGroupRequest listTagsLogGroupRequest) throws ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Deprecated.Please use the generic tagging API ListTagsForResourceThe ListTagsLogGroup operation is on the path to deprecation. We recommend that you use ListTagsForResource instead.
Lists the tags for the specified log group.
- Parameters:
listTagsLogGroupRequest-- Returns:
- Result of the ListTagsLogGroup operation returned by the service.
- See Also:
-
listTagsLogGroup
@Deprecated default ListTagsLogGroupResponse listTagsLogGroup(Consumer<ListTagsLogGroupRequest.Builder> listTagsLogGroupRequest) throws ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Deprecated.Please use the generic tagging API ListTagsForResourceThe ListTagsLogGroup operation is on the path to deprecation. We recommend that you use ListTagsForResource instead.
Lists the tags for the specified log group.
This is a convenience which creates an instance of the
ListTagsLogGroupRequest.Builderavoiding the need to create one manually viaListTagsLogGroupRequest.builder()- Parameters:
listTagsLogGroupRequest- AConsumerthat will call methods onListTagsLogGroupRequest.Builderto create a request.- Returns:
- Result of the ListTagsLogGroup operation returned by the service.
- See Also:
-
putAccountPolicy
default PutAccountPolicyResponse putAccountPolicy(PutAccountPolicyRequest putAccountPolicyRequest) throws InvalidParameterException, OperationAbortedException, ServiceUnavailableException, LimitExceededException, AwsServiceException, SdkClientException, CloudWatchLogsException 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.
Data protection policy
A data protection policy can help safeguard sensitive data that's ingested by your log groups by auditing and masking the sensitive log data. Each account can have only one account-level data protection policy.
Sensitive data is detected and masked when it is ingested into a log group. When you set a data protection policy, log events ingested into the log groups before that time are not masked.
If you use
PutAccountPolicyto create a data protection policy for your whole account, it applies to both existing log groups and all log groups that are created later in this account. The account-level policy is applied to existing log groups with eventual consistency. It might take up to 5 minutes before sensitive data in existing log groups begins to be masked.By default, when a user views a log event that includes masked data, the sensitive data is replaced by asterisks. A user who has the
logs:Unmaskpermission can use a GetLogEvents or FilterLogEvents operation with theunmaskparameter set totrueto view the unmasked log events. Users with thelogs:Unmaskcan also view unmasked data in the CloudWatch Logs console by running a CloudWatch Logs Insights query with theunmaskquery command.For more information, including a list of types of data that can be audited and masked, see Protect sensitive log data with masking.
To use the
PutAccountPolicyoperation for a data protection policy, you must be signed on with thelogs:PutDataProtectionPolicyandlogs:PutAccountPolicypermissions.The
PutAccountPolicyoperation applies to all log groups in the account. You can use PutDataProtectionPolicy to create a data protection policy that applies to just one log group. If a log group has its own data protection policy and the account also has an account-level data protection policy, then the two policies are cumulative. Any sensitive term specified in either policy is masked.Subscription filter policy
A subscription filter policy sets up a real-time feed of log events from CloudWatch Logs to other Amazon Web Services services. Account-level subscription filter policies apply to both existing log groups and log groups that are created later in this account. Supported destinations are Kinesis Data Streams, Firehose, and Lambda. When log events are sent to the receiving service, they are Base64 encoded and compressed with the GZIP format.
The following destinations are supported for subscription filters:
-
An Kinesis Data Streams data stream in the same account as the subscription policy, for same-account delivery.
-
An Firehose data stream in the same account as the subscription policy, for same-account delivery.
-
A Lambda function in the same account as the subscription policy, for same-account delivery.
-
A logical destination in a different account created with PutDestination, for cross-account delivery. Kinesis Data Streams and Firehose are supported as logical destinations.
Each account can have one account-level subscription filter policy per Region. If you are updating an existing filter, you must specify the correct name in
PolicyName. To perform aPutAccountPolicysubscription filter operation for any destination except a Lambda function, you must also have theiam:PassRolepermission.- Parameters:
putAccountPolicyRequest-- Returns:
- Result of the PutAccountPolicy operation returned by the service.
- See Also:
-
-
putAccountPolicy
default PutAccountPolicyResponse putAccountPolicy(Consumer<PutAccountPolicyRequest.Builder> putAccountPolicyRequest) throws InvalidParameterException, OperationAbortedException, ServiceUnavailableException, LimitExceededException, AwsServiceException, SdkClientException, CloudWatchLogsException 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.
Data protection policy
A data protection policy can help safeguard sensitive data that's ingested by your log groups by auditing and masking the sensitive log data. Each account can have only one account-level data protection policy.
Sensitive data is detected and masked when it is ingested into a log group. When you set a data protection policy, log events ingested into the log groups before that time are not masked.
If you use
PutAccountPolicyto create a data protection policy for your whole account, it applies to both existing log groups and all log groups that are created later in this account. The account-level policy is applied to existing log groups with eventual consistency. It might take up to 5 minutes before sensitive data in existing log groups begins to be masked.By default, when a user views a log event that includes masked data, the sensitive data is replaced by asterisks. A user who has the
logs:Unmaskpermission can use a GetLogEvents or FilterLogEvents operation with theunmaskparameter set totrueto view the unmasked log events. Users with thelogs:Unmaskcan also view unmasked data in the CloudWatch Logs console by running a CloudWatch Logs Insights query with theunmaskquery command.For more information, including a list of types of data that can be audited and masked, see Protect sensitive log data with masking.
To use the
PutAccountPolicyoperation for a data protection policy, you must be signed on with thelogs:PutDataProtectionPolicyandlogs:PutAccountPolicypermissions.The
PutAccountPolicyoperation applies to all log groups in the account. You can use PutDataProtectionPolicy to create a data protection policy that applies to just one log group. If a log group has its own data protection policy and the account also has an account-level data protection policy, then the two policies are cumulative. Any sensitive term specified in either policy is masked.Subscription filter policy
A subscription filter policy sets up a real-time feed of log events from CloudWatch Logs to other Amazon Web Services services. Account-level subscription filter policies apply to both existing log groups and log groups that are created later in this account. Supported destinations are Kinesis Data Streams, Firehose, and Lambda. When log events are sent to the receiving service, they are Base64 encoded and compressed with the GZIP format.
The following destinations are supported for subscription filters:
-
An Kinesis Data Streams data stream in the same account as the subscription policy, for same-account delivery.
-
An Firehose data stream in the same account as the subscription policy, for same-account delivery.
-
A Lambda function in the same account as the subscription policy, for same-account delivery.
-
A logical destination in a different account created with PutDestination, for cross-account delivery. Kinesis Data Streams and Firehose are supported as logical destinations.
Each account can have one account-level subscription filter policy per Region. If you are updating an existing filter, you must specify the correct name in
PolicyName. To perform aPutAccountPolicysubscription filter operation for any destination except a Lambda function, you must also have theiam:PassRolepermission.
This is a convenience which creates an instance of the
PutAccountPolicyRequest.Builderavoiding the need to create one manually viaPutAccountPolicyRequest.builder()- Parameters:
putAccountPolicyRequest- AConsumerthat will call methods onPutAccountPolicyRequest.Builderto create a request.- Returns:
- Result of the PutAccountPolicy operation returned by the service.
- See Also:
-
-
putDataProtectionPolicy
default PutDataProtectionPolicyResponse putDataProtectionPolicy(PutDataProtectionPolicyRequest putDataProtectionPolicyRequest) throws InvalidParameterException, LimitExceededException, OperationAbortedException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Creates a data protection policy for the specified log group. A data protection policy can help safeguard sensitive data that's ingested by the log group by auditing and masking the sensitive log data.
Sensitive data is detected and masked when it is ingested into the log group. When you set a data protection policy, log events ingested into the log group before that time are not masked.
By default, when a user views a log event that includes masked data, the sensitive data is replaced by asterisks. A user who has the
logs:Unmaskpermission can use a GetLogEvents or FilterLogEvents operation with theunmaskparameter set totrueto view the unmasked log events. Users with thelogs:Unmaskcan also view unmasked data in the CloudWatch Logs console by running a CloudWatch Logs Insights query with theunmaskquery command.For more information, including a list of types of data that can be audited and masked, see Protect sensitive log data with masking.
The
PutDataProtectionPolicyoperation applies to only the specified log group. You can also use PutAccountPolicy to create an account-level data protection policy that applies to all log groups in the account, including both existing log groups and log groups that are created level. If a log group has its own data protection policy and the account also has an account-level data protection policy, then the two policies are cumulative. Any sensitive term specified in either policy is masked.- Parameters:
putDataProtectionPolicyRequest-- Returns:
- Result of the PutDataProtectionPolicy operation returned by the service.
- See Also:
-
putDataProtectionPolicy
default PutDataProtectionPolicyResponse putDataProtectionPolicy(Consumer<PutDataProtectionPolicyRequest.Builder> putDataProtectionPolicyRequest) throws InvalidParameterException, LimitExceededException, OperationAbortedException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Creates a data protection policy for the specified log group. A data protection policy can help safeguard sensitive data that's ingested by the log group by auditing and masking the sensitive log data.
Sensitive data is detected and masked when it is ingested into the log group. When you set a data protection policy, log events ingested into the log group before that time are not masked.
By default, when a user views a log event that includes masked data, the sensitive data is replaced by asterisks. A user who has the
logs:Unmaskpermission can use a GetLogEvents or FilterLogEvents operation with theunmaskparameter set totrueto view the unmasked log events. Users with thelogs:Unmaskcan also view unmasked data in the CloudWatch Logs console by running a CloudWatch Logs Insights query with theunmaskquery command.For more information, including a list of types of data that can be audited and masked, see Protect sensitive log data with masking.
The
PutDataProtectionPolicyoperation applies to only the specified log group. You can also use PutAccountPolicy to create an account-level data protection policy that applies to all log groups in the account, including both existing log groups and log groups that are created level. If a log group has its own data protection policy and the account also has an account-level data protection policy, then the two policies are cumulative. Any sensitive term specified in either policy is masked.
This is a convenience which creates an instance of the
PutDataProtectionPolicyRequest.Builderavoiding the need to create one manually viaPutDataProtectionPolicyRequest.builder()- Parameters:
putDataProtectionPolicyRequest- AConsumerthat will call methods onPutDataProtectionPolicyRequest.Builderto create a request.- Returns:
- Result of the PutDataProtectionPolicy operation returned by the service.
- See Also:
-
putDeliveryDestination
default PutDeliveryDestinationResponse putDeliveryDestination(PutDeliveryDestinationRequest putDeliveryDestinationRequest) throws ServiceUnavailableException, ConflictException, ValidationException, ServiceQuotaExceededException, ThrottlingException, ResourceNotFoundException, AwsServiceException, SdkClientException, CloudWatchLogsException Creates or updates a logical delivery destination. A delivery destination is an Amazon Web Services resource that represents an Amazon Web Services service that logs can be sent to. CloudWatch Logs, Amazon S3, and Firehose are supported as logs delivery destinations.
To configure logs delivery between a supported Amazon Web Services service and a destination, you must do the following:
-
Create a delivery source, which is a logical object that represents the resource that is actually sending the logs. For more information, see PutDeliverySource.
-
Use
PutDeliveryDestinationto create a delivery destination, which is a logical object that represents the actual delivery destination. -
If you are delivering logs cross-account, you must use PutDeliveryDestinationPolicy in the destination account to assign an IAM policy to the destination. This policy allows delivery to that destination.
-
Use
CreateDeliveryto create a delivery by pairing exactly one delivery source and one delivery destination. For more information, see CreateDelivery.
You can configure a single delivery source to send logs to multiple destinations by creating multiple deliveries. You can also create multiple deliveries to configure multiple delivery sources to send logs to the same delivery destination.
Only some Amazon Web Services services support being configured as a delivery source. These services are listed as Supported [V2 Permissions] in the table at Enabling logging from Amazon Web Services services.
If you use this operation to update an existing delivery destination, all the current delivery destination parameters are overwritten with the new parameter values that you specify.
- Parameters:
putDeliveryDestinationRequest-- Returns:
- Result of the PutDeliveryDestination operation returned by the service.
- See Also:
-
-
putDeliveryDestination
default PutDeliveryDestinationResponse putDeliveryDestination(Consumer<PutDeliveryDestinationRequest.Builder> putDeliveryDestinationRequest) throws ServiceUnavailableException, ConflictException, ValidationException, ServiceQuotaExceededException, ThrottlingException, ResourceNotFoundException, AwsServiceException, SdkClientException, CloudWatchLogsException Creates or updates a logical delivery destination. A delivery destination is an Amazon Web Services resource that represents an Amazon Web Services service that logs can be sent to. CloudWatch Logs, Amazon S3, and Firehose are supported as logs delivery destinations.
To configure logs delivery between a supported Amazon Web Services service and a destination, you must do the following:
-
Create a delivery source, which is a logical object that represents the resource that is actually sending the logs. For more information, see PutDeliverySource.
-
Use
PutDeliveryDestinationto create a delivery destination, which is a logical object that represents the actual delivery destination. -
If you are delivering logs cross-account, you must use PutDeliveryDestinationPolicy in the destination account to assign an IAM policy to the destination. This policy allows delivery to that destination.
-
Use
CreateDeliveryto create a delivery by pairing exactly one delivery source and one delivery destination. For more information, see CreateDelivery.
You can configure a single delivery source to send logs to multiple destinations by creating multiple deliveries. You can also create multiple deliveries to configure multiple delivery sources to send logs to the same delivery destination.
Only some Amazon Web Services services support being configured as a delivery source. These services are listed as Supported [V2 Permissions] in the table at Enabling logging from Amazon Web Services services.
If you use this operation to update an existing delivery destination, all the current delivery destination parameters are overwritten with the new parameter values that you specify.
This is a convenience which creates an instance of the
PutDeliveryDestinationRequest.Builderavoiding the need to create one manually viaPutDeliveryDestinationRequest.builder()- Parameters:
putDeliveryDestinationRequest- AConsumerthat will call methods onPutDeliveryDestinationRequest.Builderto create a request.- Returns:
- Result of the PutDeliveryDestination operation returned by the service.
- See Also:
-
-
putDeliveryDestinationPolicy
default PutDeliveryDestinationPolicyResponse putDeliveryDestinationPolicy(PutDeliveryDestinationPolicyRequest putDeliveryDestinationPolicyRequest) throws ServiceUnavailableException, ValidationException, ResourceNotFoundException, ConflictException, AwsServiceException, SdkClientException, CloudWatchLogsException Creates and assigns an IAM policy that grants permissions to CloudWatch Logs to deliver logs cross-account to a specified destination in this account. To configure the delivery of logs from an Amazon Web Services service in another account to a logs delivery destination in the current account, you must do the following:
-
Create a delivery source, which is a logical object that represents the resource that is actually sending the logs. For more information, see PutDeliverySource.
-
Create a delivery destination, which is a logical object that represents the actual delivery destination. For more information, see PutDeliveryDestination.
-
Use this operation in the destination account to assign an IAM policy to the destination. This policy allows delivery to that destination.
-
Create a delivery by pairing exactly one delivery source and one delivery destination. For more information, see CreateDelivery.
Only some Amazon Web Services services support being configured as a delivery source. These services are listed as Supported [V2 Permissions] in the table at Enabling logging from Amazon Web Services services.
The contents of the policy must include two statements. One statement enables general logs delivery, and the other allows delivery to the chosen destination. See the examples for the needed policies.
- Parameters:
putDeliveryDestinationPolicyRequest-- Returns:
- Result of the PutDeliveryDestinationPolicy operation returned by the service.
- See Also:
-
-
putDeliveryDestinationPolicy
default PutDeliveryDestinationPolicyResponse putDeliveryDestinationPolicy(Consumer<PutDeliveryDestinationPolicyRequest.Builder> putDeliveryDestinationPolicyRequest) throws ServiceUnavailableException, ValidationException, ResourceNotFoundException, ConflictException, AwsServiceException, SdkClientException, CloudWatchLogsException Creates and assigns an IAM policy that grants permissions to CloudWatch Logs to deliver logs cross-account to a specified destination in this account. To configure the delivery of logs from an Amazon Web Services service in another account to a logs delivery destination in the current account, you must do the following:
-
Create a delivery source, which is a logical object that represents the resource that is actually sending the logs. For more information, see PutDeliverySource.
-
Create a delivery destination, which is a logical object that represents the actual delivery destination. For more information, see PutDeliveryDestination.
-
Use this operation in the destination account to assign an IAM policy to the destination. This policy allows delivery to that destination.
-
Create a delivery by pairing exactly one delivery source and one delivery destination. For more information, see CreateDelivery.
Only some Amazon Web Services services support being configured as a delivery source. These services are listed as Supported [V2 Permissions] in the table at Enabling logging from Amazon Web Services services.
The contents of the policy must include two statements. One statement enables general logs delivery, and the other allows delivery to the chosen destination. See the examples for the needed policies.
This is a convenience which creates an instance of the
PutDeliveryDestinationPolicyRequest.Builderavoiding the need to create one manually viaPutDeliveryDestinationPolicyRequest.builder()- Parameters:
putDeliveryDestinationPolicyRequest- AConsumerthat will call methods onPutDeliveryDestinationPolicyRequest.Builderto create a request.- Returns:
- Result of the PutDeliveryDestinationPolicy operation returned by the service.
- See Also:
-
-
putDeliverySource
default PutDeliverySourceResponse putDeliverySource(PutDeliverySourceRequest putDeliverySourceRequest) throws ServiceUnavailableException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, ThrottlingException, AwsServiceException, SdkClientException, CloudWatchLogsException Creates or updates a logical delivery source. A delivery source represents an Amazon Web Services resource that sends logs to an logs delivery destination. The destination can be CloudWatch Logs, Amazon S3, or Firehose.
To configure logs delivery between a delivery destination and an Amazon Web Services service that is supported as a delivery source, you must do the following:
-
Use
PutDeliverySourceto create a delivery source, which is a logical object that represents the resource that is actually sending the logs. -
Use
PutDeliveryDestinationto create a delivery destination, which is a logical object that represents the actual delivery destination. For more information, see PutDeliveryDestination. -
If you are delivering logs cross-account, you must use PutDeliveryDestinationPolicy in the destination account to assign an IAM policy to the destination. This policy allows delivery to that destination.
-
Use
CreateDeliveryto create a delivery by pairing exactly one delivery source and one delivery destination. For more information, see CreateDelivery.
You can configure a single delivery source to send logs to multiple destinations by creating multiple deliveries. You can also create multiple deliveries to configure multiple delivery sources to send logs to the same delivery destination.
Only some Amazon Web Services services support being configured as a delivery source. These services are listed as Supported [V2 Permissions] in the table at Enabling logging from Amazon Web Services services.
If you use this operation to update an existing delivery source, all the current delivery source parameters are overwritten with the new parameter values that you specify.
- Parameters:
putDeliverySourceRequest-- Returns:
- Result of the PutDeliverySource operation returned by the service.
- See Also:
-
-
putDeliverySource
default PutDeliverySourceResponse putDeliverySource(Consumer<PutDeliverySourceRequest.Builder> putDeliverySourceRequest) throws ServiceUnavailableException, ConflictException, ValidationException, ServiceQuotaExceededException, ResourceNotFoundException, ThrottlingException, AwsServiceException, SdkClientException, CloudWatchLogsException Creates or updates a logical delivery source. A delivery source represents an Amazon Web Services resource that sends logs to an logs delivery destination. The destination can be CloudWatch Logs, Amazon S3, or Firehose.
To configure logs delivery between a delivery destination and an Amazon Web Services service that is supported as a delivery source, you must do the following:
-
Use
PutDeliverySourceto create a delivery source, which is a logical object that represents the resource that is actually sending the logs. -
Use
PutDeliveryDestinationto create a delivery destination, which is a logical object that represents the actual delivery destination. For more information, see PutDeliveryDestination. -
If you are delivering logs cross-account, you must use PutDeliveryDestinationPolicy in the destination account to assign an IAM policy to the destination. This policy allows delivery to that destination.
-
Use
CreateDeliveryto create a delivery by pairing exactly one delivery source and one delivery destination. For more information, see CreateDelivery.
You can configure a single delivery source to send logs to multiple destinations by creating multiple deliveries. You can also create multiple deliveries to configure multiple delivery sources to send logs to the same delivery destination.
Only some Amazon Web Services services support being configured as a delivery source. These services are listed as Supported [V2 Permissions] in the table at Enabling logging from Amazon Web Services services.
If you use this operation to update an existing delivery source, all the current delivery source parameters are overwritten with the new parameter values that you specify.
This is a convenience which creates an instance of the
PutDeliverySourceRequest.Builderavoiding the need to create one manually viaPutDeliverySourceRequest.builder()- Parameters:
putDeliverySourceRequest- AConsumerthat will call methods onPutDeliverySourceRequest.Builderto create a request.- Returns:
- Result of the PutDeliverySource operation returned by the service.
- See Also:
-
-
putDestination
default PutDestinationResponse putDestination(PutDestinationRequest putDestinationRequest) throws InvalidParameterException, OperationAbortedException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Creates or updates a destination. This operation is used only to create destinations for cross-account subscriptions.
A destination encapsulates a physical resource (such as an Amazon Kinesis stream). With a destination, you can subscribe to a real-time stream of log events for a different account, ingested using PutLogEvents.
Through an access policy, a destination controls what is written to it. By default,
PutDestinationdoes not set any access policy with the destination, which means a cross-account user cannot call PutSubscriptionFilter against this destination. To enable this, the destination owner must call PutDestinationPolicy afterPutDestination.To perform a
PutDestinationoperation, you must also have theiam:PassRolepermission.- Parameters:
putDestinationRequest-- Returns:
- Result of the PutDestination operation returned by the service.
- See Also:
-
putDestination
default PutDestinationResponse putDestination(Consumer<PutDestinationRequest.Builder> putDestinationRequest) throws InvalidParameterException, OperationAbortedException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Creates or updates a destination. This operation is used only to create destinations for cross-account subscriptions.
A destination encapsulates a physical resource (such as an Amazon Kinesis stream). With a destination, you can subscribe to a real-time stream of log events for a different account, ingested using PutLogEvents.
Through an access policy, a destination controls what is written to it. By default,
PutDestinationdoes not set any access policy with the destination, which means a cross-account user cannot call PutSubscriptionFilter against this destination. To enable this, the destination owner must call PutDestinationPolicy afterPutDestination.To perform a
PutDestinationoperation, you must also have theiam:PassRolepermission.
This is a convenience which creates an instance of the
PutDestinationRequest.Builderavoiding the need to create one manually viaPutDestinationRequest.builder()- Parameters:
putDestinationRequest- AConsumerthat will call methods onPutDestinationRequest.Builderto create a request.- Returns:
- Result of the PutDestination operation returned by the service.
- See Also:
-
putDestinationPolicy
default PutDestinationPolicyResponse putDestinationPolicy(PutDestinationPolicyRequest putDestinationPolicyRequest) throws InvalidParameterException, OperationAbortedException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Creates or updates an access policy associated with an existing destination. An access policy is an IAM policy document that is used to authorize claims to register a subscription filter against a given destination.
- Parameters:
putDestinationPolicyRequest-- Returns:
- Result of the PutDestinationPolicy operation returned by the service.
- See Also:
-
putDestinationPolicy
default PutDestinationPolicyResponse putDestinationPolicy(Consumer<PutDestinationPolicyRequest.Builder> putDestinationPolicyRequest) throws InvalidParameterException, OperationAbortedException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Creates or updates an access policy associated with an existing destination. An access policy is an IAM policy document that is used to authorize claims to register a subscription filter against a given destination.
This is a convenience which creates an instance of the
PutDestinationPolicyRequest.Builderavoiding the need to create one manually viaPutDestinationPolicyRequest.builder()- Parameters:
putDestinationPolicyRequest- AConsumerthat will call methods onPutDestinationPolicyRequest.Builderto create a request.- Returns:
- Result of the PutDestinationPolicy operation returned by the service.
- See Also:
-
putLogEvents
default PutLogEventsResponse putLogEvents(PutLogEventsRequest putLogEventsRequest) throws InvalidParameterException, InvalidSequenceTokenException, DataAlreadyAcceptedException, ResourceNotFoundException, ServiceUnavailableException, UnrecognizedClientException, AwsServiceException, SdkClientException, CloudWatchLogsException Uploads a batch of log events to the specified log stream.
The sequence token is now ignored in
PutLogEventsactions.PutLogEventsactions are always accepted and never returnInvalidSequenceTokenExceptionorDataAlreadyAcceptedExceptioneven if the sequence token is not valid. You can use parallelPutLogEventsactions on the same log stream.The batch of events must satisfy the following constraints:
-
The maximum batch size is 1,048,576 bytes. This size is calculated as the sum of all event messages in UTF-8, plus 26 bytes for each log event.
-
None of the log events in the batch can be more than 2 hours in the future.
-
None of the log events in the batch can be more than 14 days in the past. Also, none of the log events can be from earlier than the retention period of the log group.
-
The log events in the batch must be in chronological order by their timestamp. The timestamp is the time that the event occurred, expressed as the number of milliseconds after
Jan 1, 1970 00:00:00 UTC. (In Amazon Web Services Tools for PowerShell and the Amazon Web Services SDK for .NET, the timestamp is specified in .NET format:yyyy-mm-ddThh:mm:ss. For example,2017-09-15T13:45:30.) -
A batch of log events in a single request cannot span more than 24 hours. Otherwise, the operation fails.
-
Each log event can be no larger than 256 KB.
-
The maximum number of log events in a batch is 10,000.
The quota of five requests per second per log stream has been removed. Instead,
PutLogEventsactions are throttled based on a per-second per-account quota. You can request an increase to the per-second throttling quota by using the Service Quotas service.
If a call to
PutLogEventsreturns "UnrecognizedClientException" the most likely cause is a non-valid Amazon Web Services access key ID or secret key.- Parameters:
putLogEventsRequest-- Returns:
- Result of the PutLogEvents operation returned by the service.
- See Also:
-
-
putLogEvents
default PutLogEventsResponse putLogEvents(Consumer<PutLogEventsRequest.Builder> putLogEventsRequest) throws InvalidParameterException, InvalidSequenceTokenException, DataAlreadyAcceptedException, ResourceNotFoundException, ServiceUnavailableException, UnrecognizedClientException, AwsServiceException, SdkClientException, CloudWatchLogsException Uploads a batch of log events to the specified log stream.
The sequence token is now ignored in
PutLogEventsactions.PutLogEventsactions are always accepted and never returnInvalidSequenceTokenExceptionorDataAlreadyAcceptedExceptioneven if the sequence token is not valid. You can use parallelPutLogEventsactions on the same log stream.The batch of events must satisfy the following constraints:
-
The maximum batch size is 1,048,576 bytes. This size is calculated as the sum of all event messages in UTF-8, plus 26 bytes for each log event.
-
None of the log events in the batch can be more than 2 hours in the future.
-
None of the log events in the batch can be more than 14 days in the past. Also, none of the log events can be from earlier than the retention period of the log group.
-
The log events in the batch must be in chronological order by their timestamp. The timestamp is the time that the event occurred, expressed as the number of milliseconds after
Jan 1, 1970 00:00:00 UTC. (In Amazon Web Services Tools for PowerShell and the Amazon Web Services SDK for .NET, the timestamp is specified in .NET format:yyyy-mm-ddThh:mm:ss. For example,2017-09-15T13:45:30.) -
A batch of log events in a single request cannot span more than 24 hours. Otherwise, the operation fails.
-
Each log event can be no larger than 256 KB.
-
The maximum number of log events in a batch is 10,000.
The quota of five requests per second per log stream has been removed. Instead,
PutLogEventsactions are throttled based on a per-second per-account quota. You can request an increase to the per-second throttling quota by using the Service Quotas service.
If a call to
PutLogEventsreturns "UnrecognizedClientException" the most likely cause is a non-valid Amazon Web Services access key ID or secret key.
This is a convenience which creates an instance of the
PutLogEventsRequest.Builderavoiding the need to create one manually viaPutLogEventsRequest.builder()- Parameters:
putLogEventsRequest- AConsumerthat will call methods onPutLogEventsRequest.Builderto create a request.- Returns:
- Result of the PutLogEvents operation returned by the service.
- See Also:
-
-
putMetricFilter
default PutMetricFilterResponse putMetricFilter(PutMetricFilterRequest putMetricFilterRequest) throws InvalidParameterException, ResourceNotFoundException, OperationAbortedException, LimitExceededException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Creates or updates a metric filter and associates it with the specified log group. With metric filters, you can configure rules to extract metric data from log events ingested through PutLogEvents.
The maximum number of metric filters that can be associated with a log group is 100.
Using regular expressions to create metric filters is supported. For these filters, there is a quotas of quota of two regular expression patterns within a single filter pattern. There is also a quota of five regular expression patterns per log group. For more information about using regular expressions in metric filters, see Filter pattern syntax for metric filters, subscription filters, filter log events, and Live Tail.
When you create a metric filter, you can also optionally assign a unit and dimensions to the metric that is created.
Metrics extracted from log events are charged as custom metrics. To prevent unexpected high charges, do not specify high-cardinality fields such as
IPAddressorrequestIDas dimensions. Each different value found for a dimension is treated as a separate metric and accrues charges as a separate custom metric.CloudWatch Logs might disable a metric filter if it generates 1,000 different name/value pairs for your specified dimensions within one hour.
You can also set up a billing alarm to alert you if your charges are higher than expected. For more information, see Creating a Billing Alarm to Monitor Your Estimated Amazon Web Services Charges.
- Parameters:
putMetricFilterRequest-- Returns:
- Result of the PutMetricFilter operation returned by the service.
- See Also:
-
putMetricFilter
default PutMetricFilterResponse putMetricFilter(Consumer<PutMetricFilterRequest.Builder> putMetricFilterRequest) throws InvalidParameterException, ResourceNotFoundException, OperationAbortedException, LimitExceededException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Creates or updates a metric filter and associates it with the specified log group. With metric filters, you can configure rules to extract metric data from log events ingested through PutLogEvents.
The maximum number of metric filters that can be associated with a log group is 100.
Using regular expressions to create metric filters is supported. For these filters, there is a quotas of quota of two regular expression patterns within a single filter pattern. There is also a quota of five regular expression patterns per log group. For more information about using regular expressions in metric filters, see Filter pattern syntax for metric filters, subscription filters, filter log events, and Live Tail.
When you create a metric filter, you can also optionally assign a unit and dimensions to the metric that is created.
Metrics extracted from log events are charged as custom metrics. To prevent unexpected high charges, do not specify high-cardinality fields such as
IPAddressorrequestIDas dimensions. Each different value found for a dimension is treated as a separate metric and accrues charges as a separate custom metric.CloudWatch Logs might disable a metric filter if it generates 1,000 different name/value pairs for your specified dimensions within one hour.
You can also set up a billing alarm to alert you if your charges are higher than expected. For more information, see Creating a Billing Alarm to Monitor Your Estimated Amazon Web Services Charges.
This is a convenience which creates an instance of the
PutMetricFilterRequest.Builderavoiding the need to create one manually viaPutMetricFilterRequest.builder()- Parameters:
putMetricFilterRequest- AConsumerthat will call methods onPutMetricFilterRequest.Builderto create a request.- Returns:
- Result of the PutMetricFilter operation returned by the service.
- See Also:
-
putQueryDefinition
default PutQueryDefinitionResponse putQueryDefinition(PutQueryDefinitionRequest putQueryDefinitionRequest) throws InvalidParameterException, LimitExceededException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Creates or updates a query definition for CloudWatch Logs Insights. For more information, see Analyzing Log Data with CloudWatch Logs Insights.
To update a query definition, specify its
queryDefinitionIdin your request. The values ofname,queryString, andlogGroupNamesare changed to the values that you specify in your update operation. No current values are retained from the current query definition. For example, imagine updating a current query definition that includes log groups. If you don't specify thelogGroupNamesparameter in your update operation, the query definition changes to contain no log groups.You must have the
logs:PutQueryDefinitionpermission to be able to perform this operation.- Parameters:
putQueryDefinitionRequest-- Returns:
- Result of the PutQueryDefinition operation returned by the service.
- See Also:
-
putQueryDefinition
default PutQueryDefinitionResponse putQueryDefinition(Consumer<PutQueryDefinitionRequest.Builder> putQueryDefinitionRequest) throws InvalidParameterException, LimitExceededException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Creates or updates a query definition for CloudWatch Logs Insights. For more information, see Analyzing Log Data with CloudWatch Logs Insights.
To update a query definition, specify its
queryDefinitionIdin your request. The values ofname,queryString, andlogGroupNamesare changed to the values that you specify in your update operation. No current values are retained from the current query definition. For example, imagine updating a current query definition that includes log groups. If you don't specify thelogGroupNamesparameter in your update operation, the query definition changes to contain no log groups.You must have the
logs:PutQueryDefinitionpermission to be able to perform this operation.
This is a convenience which creates an instance of the
PutQueryDefinitionRequest.Builderavoiding the need to create one manually viaPutQueryDefinitionRequest.builder()- Parameters:
putQueryDefinitionRequest- AConsumerthat will call methods onPutQueryDefinitionRequest.Builderto create a request.- Returns:
- Result of the PutQueryDefinition operation returned by the service.
- See Also:
-
putResourcePolicy
default PutResourcePolicyResponse putResourcePolicy(PutResourcePolicyRequest putResourcePolicyRequest) throws InvalidParameterException, LimitExceededException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Creates or updates a resource policy allowing other Amazon Web Services services to put log events to this account, such as Amazon Route 53. An account can have up to 10 resource policies per Amazon Web Services Region.
- Parameters:
putResourcePolicyRequest-- Returns:
- Result of the PutResourcePolicy operation returned by the service.
- See Also:
-
putResourcePolicy
default PutResourcePolicyResponse putResourcePolicy(Consumer<PutResourcePolicyRequest.Builder> putResourcePolicyRequest) throws InvalidParameterException, LimitExceededException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Creates or updates a resource policy allowing other Amazon Web Services services to put log events to this account, such as Amazon Route 53. An account can have up to 10 resource policies per Amazon Web Services Region.
This is a convenience which creates an instance of the
PutResourcePolicyRequest.Builderavoiding the need to create one manually viaPutResourcePolicyRequest.builder()- Parameters:
putResourcePolicyRequest- AConsumerthat will call methods onPutResourcePolicyRequest.Builderto create a request.- Returns:
- Result of the PutResourcePolicy operation returned by the service.
- See Also:
-
putRetentionPolicy
default PutRetentionPolicyResponse putRetentionPolicy(PutRetentionPolicyRequest putRetentionPolicyRequest) throws InvalidParameterException, ResourceNotFoundException, OperationAbortedException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Sets the retention of the specified log group. With a retention policy, you can configure the number of days for which to retain log events in the specified log group.
CloudWatch Logs doesn't immediately delete log events when they reach their retention setting. It typically takes up to 72 hours after that before log events are deleted, but in rare situations might take longer.
To illustrate, imagine that you change a log group to have a longer retention setting when it contains log events that are past the expiration date, but haven't been deleted. Those log events will take up to 72 hours to be deleted after the new retention date is reached. To make sure that log data is deleted permanently, keep a log group at its lower retention setting until 72 hours after the previous retention period ends. Alternatively, wait to change the retention setting until you confirm that the earlier log events are deleted.
When log events reach their retention setting they are marked for deletion. After they are marked for deletion, they do not add to your archival storage costs anymore, even if they are not actually deleted until later. These log events marked for deletion are also not included when you use an API to retrieve the
storedBytesvalue to see how many bytes a log group is storing.- Parameters:
putRetentionPolicyRequest-- Returns:
- Result of the PutRetentionPolicy operation returned by the service.
- See Also:
-
putRetentionPolicy
default PutRetentionPolicyResponse putRetentionPolicy(Consumer<PutRetentionPolicyRequest.Builder> putRetentionPolicyRequest) throws InvalidParameterException, ResourceNotFoundException, OperationAbortedException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Sets the retention of the specified log group. With a retention policy, you can configure the number of days for which to retain log events in the specified log group.
CloudWatch Logs doesn't immediately delete log events when they reach their retention setting. It typically takes up to 72 hours after that before log events are deleted, but in rare situations might take longer.
To illustrate, imagine that you change a log group to have a longer retention setting when it contains log events that are past the expiration date, but haven't been deleted. Those log events will take up to 72 hours to be deleted after the new retention date is reached. To make sure that log data is deleted permanently, keep a log group at its lower retention setting until 72 hours after the previous retention period ends. Alternatively, wait to change the retention setting until you confirm that the earlier log events are deleted.
When log events reach their retention setting they are marked for deletion. After they are marked for deletion, they do not add to your archival storage costs anymore, even if they are not actually deleted until later. These log events marked for deletion are also not included when you use an API to retrieve the
storedBytesvalue to see how many bytes a log group is storing.
This is a convenience which creates an instance of the
PutRetentionPolicyRequest.Builderavoiding the need to create one manually viaPutRetentionPolicyRequest.builder()- Parameters:
putRetentionPolicyRequest- AConsumerthat will call methods onPutRetentionPolicyRequest.Builderto create a request.- Returns:
- Result of the PutRetentionPolicy operation returned by the service.
- See Also:
-
putSubscriptionFilter
default PutSubscriptionFilterResponse putSubscriptionFilter(PutSubscriptionFilterRequest putSubscriptionFilterRequest) throws InvalidParameterException, ResourceNotFoundException, OperationAbortedException, LimitExceededException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Creates or updates a subscription filter and associates it with the specified log group. With subscription filters, you can subscribe to a real-time stream of log events ingested through PutLogEvents and have them delivered to a specific destination. When log events are sent to the receiving service, they are Base64 encoded and compressed with the GZIP format.
The following destinations are supported for subscription filters:
-
An Amazon Kinesis data stream belonging to the same account as the subscription filter, for same-account delivery.
-
A logical destination created with PutDestination that belongs to a different account, for cross-account delivery. We currently support Kinesis Data Streams and Firehose as logical destinations.
-
An Amazon Kinesis Data Firehose delivery stream that belongs to the same account as the subscription filter, for same-account delivery.
-
An Lambda function that belongs to the same account as the subscription filter, for same-account delivery.
Each log group can have up to two subscription filters associated with it. If you are updating an existing filter, you must specify the correct name in
filterName.Using regular expressions to create subscription filters is supported. For these filters, there is a quotas of quota of two regular expression patterns within a single filter pattern. There is also a quota of five regular expression patterns per log group. For more information about using regular expressions in subscription filters, see Filter pattern syntax for metric filters, subscription filters, filter log events, and Live Tail.
To perform a
PutSubscriptionFilteroperation for any destination except a Lambda function, you must also have theiam:PassRolepermission.- Parameters:
putSubscriptionFilterRequest-- Returns:
- Result of the PutSubscriptionFilter operation returned by the service.
- See Also:
-
-
putSubscriptionFilter
default PutSubscriptionFilterResponse putSubscriptionFilter(Consumer<PutSubscriptionFilterRequest.Builder> putSubscriptionFilterRequest) throws InvalidParameterException, ResourceNotFoundException, OperationAbortedException, LimitExceededException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Creates or updates a subscription filter and associates it with the specified log group. With subscription filters, you can subscribe to a real-time stream of log events ingested through PutLogEvents and have them delivered to a specific destination. When log events are sent to the receiving service, they are Base64 encoded and compressed with the GZIP format.
The following destinations are supported for subscription filters:
-
An Amazon Kinesis data stream belonging to the same account as the subscription filter, for same-account delivery.
-
A logical destination created with PutDestination that belongs to a different account, for cross-account delivery. We currently support Kinesis Data Streams and Firehose as logical destinations.
-
An Amazon Kinesis Data Firehose delivery stream that belongs to the same account as the subscription filter, for same-account delivery.
-
An Lambda function that belongs to the same account as the subscription filter, for same-account delivery.
Each log group can have up to two subscription filters associated with it. If you are updating an existing filter, you must specify the correct name in
filterName.Using regular expressions to create subscription filters is supported. For these filters, there is a quotas of quota of two regular expression patterns within a single filter pattern. There is also a quota of five regular expression patterns per log group. For more information about using regular expressions in subscription filters, see Filter pattern syntax for metric filters, subscription filters, filter log events, and Live Tail.
To perform a
PutSubscriptionFilteroperation for any destination except a Lambda function, you must also have theiam:PassRolepermission.
This is a convenience which creates an instance of the
PutSubscriptionFilterRequest.Builderavoiding the need to create one manually viaPutSubscriptionFilterRequest.builder()- Parameters:
putSubscriptionFilterRequest- AConsumerthat will call methods onPutSubscriptionFilterRequest.Builderto create a request.- Returns:
- Result of the PutSubscriptionFilter operation returned by the service.
- See Also:
-
-
startQuery
default StartQueryResponse startQuery(StartQueryRequest startQueryRequest) throws MalformedQueryException, InvalidParameterException, LimitExceededException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Schedules a query of a log group using CloudWatch Logs Insights. You specify the log group and time range to query and the query string to use.
For more information, see CloudWatch Logs Insights Query Syntax.
After you run a query using
StartQuery, the query results are stored by CloudWatch Logs. You can use GetQueryResults to retrieve the results of a query, using thequeryIdthatStartQueryreturns.If you have associated a KMS key with the query results in this account, then StartQuery uses that key to encrypt the results when it stores them. If no key is associated with query results, the query results are encrypted with the default CloudWatch Logs encryption method.
Queries time out after 60 minutes of runtime. If your queries are timing out, reduce the time range being searched or partition your query into a number of queries.
If you are using CloudWatch cross-account observability, you can use this operation in a monitoring account to start a query in a linked source account. For more information, see CloudWatch cross-account observability. For a cross-account
StartQueryoperation, the query definition must be defined in the monitoring account.You can have up to 30 concurrent CloudWatch Logs insights queries, including queries that have been added to dashboards.
- Parameters:
startQueryRequest-- Returns:
- Result of the StartQuery operation returned by the service.
- See Also:
-
startQuery
default StartQueryResponse startQuery(Consumer<StartQueryRequest.Builder> startQueryRequest) throws MalformedQueryException, InvalidParameterException, LimitExceededException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Schedules a query of a log group using CloudWatch Logs Insights. You specify the log group and time range to query and the query string to use.
For more information, see CloudWatch Logs Insights Query Syntax.
After you run a query using
StartQuery, the query results are stored by CloudWatch Logs. You can use GetQueryResults to retrieve the results of a query, using thequeryIdthatStartQueryreturns.If you have associated a KMS key with the query results in this account, then StartQuery uses that key to encrypt the results when it stores them. If no key is associated with query results, the query results are encrypted with the default CloudWatch Logs encryption method.
Queries time out after 60 minutes of runtime. If your queries are timing out, reduce the time range being searched or partition your query into a number of queries.
If you are using CloudWatch cross-account observability, you can use this operation in a monitoring account to start a query in a linked source account. For more information, see CloudWatch cross-account observability. For a cross-account
StartQueryoperation, the query definition must be defined in the monitoring account.You can have up to 30 concurrent CloudWatch Logs insights queries, including queries that have been added to dashboards.
This is a convenience which creates an instance of the
StartQueryRequest.Builderavoiding the need to create one manually viaStartQueryRequest.builder()- Parameters:
startQueryRequest- AConsumerthat will call methods onStartQueryRequest.Builderto create a request.- Returns:
- Result of the StartQuery operation returned by the service.
- See Also:
-
stopQuery
default StopQueryResponse stopQuery(StopQueryRequest stopQueryRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Stops a CloudWatch Logs Insights query that is in progress. If the query has already ended, the operation returns an error indicating that the specified query is not running.
- Parameters:
stopQueryRequest-- Returns:
- Result of the StopQuery operation returned by the service.
- See Also:
-
stopQuery
default StopQueryResponse stopQuery(Consumer<StopQueryRequest.Builder> stopQueryRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Stops a CloudWatch Logs Insights query that is in progress. If the query has already ended, the operation returns an error indicating that the specified query is not running.
This is a convenience which creates an instance of the
StopQueryRequest.Builderavoiding the need to create one manually viaStopQueryRequest.builder()- Parameters:
stopQueryRequest- AConsumerthat will call methods onStopQueryRequest.Builderto create a request.- Returns:
- Result of the StopQuery operation returned by the service.
- See Also:
-
tagLogGroup
@Deprecated default TagLogGroupResponse tagLogGroup(TagLogGroupRequest tagLogGroupRequest) throws ResourceNotFoundException, InvalidParameterException, AwsServiceException, SdkClientException, CloudWatchLogsException Deprecated.Please use the generic tagging API TagResourceThe TagLogGroup operation is on the path to deprecation. We recommend that you use TagResource instead.
Adds or updates the specified tags for the specified log group.
To list the tags for a log group, use ListTagsForResource. To remove tags, use UntagResource.
For more information about tags, see Tag Log Groups in Amazon CloudWatch Logs in the Amazon CloudWatch Logs User Guide.
CloudWatch Logs doesn't support IAM policies that prevent users from assigning specified tags to log groups using the
aws:Resource/key-nameoraws:TagKeyscondition keys. For more information about using tags to control access, see Controlling access to Amazon Web Services resources using tags.- Parameters:
tagLogGroupRequest-- Returns:
- Result of the TagLogGroup operation returned by the service.
- See Also:
-
tagLogGroup
@Deprecated default TagLogGroupResponse tagLogGroup(Consumer<TagLogGroupRequest.Builder> tagLogGroupRequest) throws ResourceNotFoundException, InvalidParameterException, AwsServiceException, SdkClientException, CloudWatchLogsException Deprecated.Please use the generic tagging API TagResourceThe TagLogGroup operation is on the path to deprecation. We recommend that you use TagResource instead.
Adds or updates the specified tags for the specified log group.
To list the tags for a log group, use ListTagsForResource. To remove tags, use UntagResource.
For more information about tags, see Tag Log Groups in Amazon CloudWatch Logs in the Amazon CloudWatch Logs User Guide.
CloudWatch Logs doesn't support IAM policies that prevent users from assigning specified tags to log groups using the
aws:Resource/key-nameoraws:TagKeyscondition keys. For more information about using tags to control access, see Controlling access to Amazon Web Services resources using tags.
This is a convenience which creates an instance of the
TagLogGroupRequest.Builderavoiding the need to create one manually viaTagLogGroupRequest.builder()- Parameters:
tagLogGroupRequest- AConsumerthat will call methods onTagLogGroupRequest.Builderto create a request.- Returns:
- Result of the TagLogGroup operation returned by the service.
- See Also:
-
tagResource
default TagResourceResponse tagResource(TagResourceRequest tagResourceRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, TooManyTagsException, AwsServiceException, SdkClientException, CloudWatchLogsException Assigns one or more tags (key-value pairs) to the specified CloudWatch Logs resource. Currently, the only CloudWatch Logs resources that can be tagged are log groups and destinations.
Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.
Tags don't have any semantic meaning to Amazon Web Services and are interpreted strictly as strings of characters.
You can use the
TagResourceaction with a resource that already has tags. If you specify a new tag key for the alarm, this tag is appended to the list of tags associated with the alarm. If you specify a tag key that is already associated with the alarm, the new tag value that you specify replaces the previous value for that tag.You can associate as many as 50 tags with a CloudWatch Logs resource.
- Parameters:
tagResourceRequest-- Returns:
- Result of the TagResource operation returned by the service.
- See Also:
-
tagResource
default TagResourceResponse tagResource(Consumer<TagResourceRequest.Builder> tagResourceRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, TooManyTagsException, AwsServiceException, SdkClientException, CloudWatchLogsException Assigns one or more tags (key-value pairs) to the specified CloudWatch Logs resource. Currently, the only CloudWatch Logs resources that can be tagged are log groups and destinations.
Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.
Tags don't have any semantic meaning to Amazon Web Services and are interpreted strictly as strings of characters.
You can use the
TagResourceaction with a resource that already has tags. If you specify a new tag key for the alarm, this tag is appended to the list of tags associated with the alarm. If you specify a tag key that is already associated with the alarm, the new tag value that you specify replaces the previous value for that tag.You can associate as many as 50 tags with a CloudWatch Logs resource.
This is a convenience which creates an instance of the
TagResourceRequest.Builderavoiding the need to create one manually viaTagResourceRequest.builder()- Parameters:
tagResourceRequest- AConsumerthat will call methods onTagResourceRequest.Builderto create a request.- Returns:
- Result of the TagResource operation returned by the service.
- See Also:
-
testMetricFilter
default TestMetricFilterResponse testMetricFilter(TestMetricFilterRequest testMetricFilterRequest) throws InvalidParameterException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Tests the filter pattern of a metric filter against a sample of log event messages. You can use this operation to validate the correctness of a metric filter pattern.
- Parameters:
testMetricFilterRequest-- Returns:
- Result of the TestMetricFilter operation returned by the service.
- See Also:
-
testMetricFilter
default TestMetricFilterResponse testMetricFilter(Consumer<TestMetricFilterRequest.Builder> testMetricFilterRequest) throws InvalidParameterException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Tests the filter pattern of a metric filter against a sample of log event messages. You can use this operation to validate the correctness of a metric filter pattern.
This is a convenience which creates an instance of the
TestMetricFilterRequest.Builderavoiding the need to create one manually viaTestMetricFilterRequest.builder()- Parameters:
testMetricFilterRequest- AConsumerthat will call methods onTestMetricFilterRequest.Builderto create a request.- Returns:
- Result of the TestMetricFilter operation returned by the service.
- See Also:
-
untagLogGroup
@Deprecated default UntagLogGroupResponse untagLogGroup(UntagLogGroupRequest untagLogGroupRequest) throws ResourceNotFoundException, AwsServiceException, SdkClientException, CloudWatchLogsException Deprecated.Please use the generic tagging API UntagResourceThe UntagLogGroup operation is on the path to deprecation. We recommend that you use UntagResource instead.
Removes the specified tags from the specified log group.
To list the tags for a log group, use ListTagsForResource. To add tags, use TagResource.
CloudWatch Logs doesn't support IAM policies that prevent users from assigning specified tags to log groups using the
aws:Resource/key-nameoraws:TagKeyscondition keys.- Parameters:
untagLogGroupRequest-- Returns:
- Result of the UntagLogGroup operation returned by the service.
- See Also:
-
untagLogGroup
@Deprecated default UntagLogGroupResponse untagLogGroup(Consumer<UntagLogGroupRequest.Builder> untagLogGroupRequest) throws ResourceNotFoundException, AwsServiceException, SdkClientException, CloudWatchLogsException Deprecated.Please use the generic tagging API UntagResourceThe UntagLogGroup operation is on the path to deprecation. We recommend that you use UntagResource instead.
Removes the specified tags from the specified log group.
To list the tags for a log group, use ListTagsForResource. To add tags, use TagResource.
CloudWatch Logs doesn't support IAM policies that prevent users from assigning specified tags to log groups using the
aws:Resource/key-nameoraws:TagKeyscondition keys.
This is a convenience which creates an instance of the
UntagLogGroupRequest.Builderavoiding the need to create one manually viaUntagLogGroupRequest.builder()- Parameters:
untagLogGroupRequest- AConsumerthat will call methods onUntagLogGroupRequest.Builderto create a request.- Returns:
- Result of the UntagLogGroup operation returned by the service.
- See Also:
-
untagResource
default UntagResourceResponse untagResource(UntagResourceRequest untagResourceRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Removes one or more tags from the specified resource.
- Parameters:
untagResourceRequest-- Returns:
- Result of the UntagResource operation returned by the service.
- See Also:
-
untagResource
default UntagResourceResponse untagResource(Consumer<UntagResourceRequest.Builder> untagResourceRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, AwsServiceException, SdkClientException, CloudWatchLogsException Removes one or more tags from the specified resource.
This is a convenience which creates an instance of the
UntagResourceRequest.Builderavoiding the need to create one manually viaUntagResourceRequest.builder()- Parameters:
untagResourceRequest- AConsumerthat will call methods onUntagResourceRequest.Builderto create a request.- Returns:
- Result of the UntagResource operation returned by the service.
- See Also:
-
updateAnomaly
default UpdateAnomalyResponse updateAnomaly(UpdateAnomalyRequest updateAnomalyRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, OperationAbortedException, AwsServiceException, SdkClientException, CloudWatchLogsException Use this operation to suppress anomaly detection for a specified anomaly or pattern. If you suppress an anomaly, CloudWatch Logs won't report new occurrences of that anomaly and won't update that anomaly with new data. If you suppress a pattern, CloudWatch Logs won't report any anomalies related to that pattern.
You must specify either
anomalyIdorpatternId, but you can't specify both parameters in the same operation.If you have previously used this operation to suppress detection of a pattern or anomaly, you can use it again to cause CloudWatch Logs to end the suppression. To do this, use this operation and specify the anomaly or pattern to stop suppressing, and omit the
suppressionTypeandsuppressionPeriodparameters.- Parameters:
updateAnomalyRequest-- Returns:
- Result of the UpdateAnomaly operation returned by the service.
- See Also:
-
updateAnomaly
default UpdateAnomalyResponse updateAnomaly(Consumer<UpdateAnomalyRequest.Builder> updateAnomalyRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, OperationAbortedException, AwsServiceException, SdkClientException, CloudWatchLogsException Use this operation to suppress anomaly detection for a specified anomaly or pattern. If you suppress an anomaly, CloudWatch Logs won't report new occurrences of that anomaly and won't update that anomaly with new data. If you suppress a pattern, CloudWatch Logs won't report any anomalies related to that pattern.
You must specify either
anomalyIdorpatternId, but you can't specify both parameters in the same operation.If you have previously used this operation to suppress detection of a pattern or anomaly, you can use it again to cause CloudWatch Logs to end the suppression. To do this, use this operation and specify the anomaly or pattern to stop suppressing, and omit the
suppressionTypeandsuppressionPeriodparameters.
This is a convenience which creates an instance of the
UpdateAnomalyRequest.Builderavoiding the need to create one manually viaUpdateAnomalyRequest.builder()- Parameters:
updateAnomalyRequest- AConsumerthat will call methods onUpdateAnomalyRequest.Builderto create a request.- Returns:
- Result of the UpdateAnomaly operation returned by the service.
- See Also:
-
updateDeliveryConfiguration
default UpdateDeliveryConfigurationResponse updateDeliveryConfiguration(UpdateDeliveryConfigurationRequest updateDeliveryConfigurationRequest) throws ServiceUnavailableException, ConflictException, ResourceNotFoundException, ValidationException, AccessDeniedException, ThrottlingException, AwsServiceException, SdkClientException, CloudWatchLogsException Use this operation to update the configuration of a delivery to change either the S3 path pattern or the format of the delivered logs. You can't use this operation to change the source or destination of the delivery.
- Parameters:
updateDeliveryConfigurationRequest-- Returns:
- Result of the UpdateDeliveryConfiguration operation returned by the service.
- See Also:
-
updateDeliveryConfiguration
default UpdateDeliveryConfigurationResponse updateDeliveryConfiguration(Consumer<UpdateDeliveryConfigurationRequest.Builder> updateDeliveryConfigurationRequest) throws ServiceUnavailableException, ConflictException, ResourceNotFoundException, ValidationException, AccessDeniedException, ThrottlingException, AwsServiceException, SdkClientException, CloudWatchLogsException Use this operation to update the configuration of a delivery to change either the S3 path pattern or the format of the delivered logs. You can't use this operation to change the source or destination of the delivery.
This is a convenience which creates an instance of the
UpdateDeliveryConfigurationRequest.Builderavoiding the need to create one manually viaUpdateDeliveryConfigurationRequest.builder()- Parameters:
updateDeliveryConfigurationRequest- AConsumerthat will call methods onUpdateDeliveryConfigurationRequest.Builderto create a request.- Returns:
- Result of the UpdateDeliveryConfiguration operation returned by the service.
- See Also:
-
updateLogAnomalyDetector
default UpdateLogAnomalyDetectorResponse updateLogAnomalyDetector(UpdateLogAnomalyDetectorRequest updateLogAnomalyDetectorRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, OperationAbortedException, AwsServiceException, SdkClientException, CloudWatchLogsException Updates an existing log anomaly detector.
- Parameters:
updateLogAnomalyDetectorRequest-- Returns:
- Result of the UpdateLogAnomalyDetector operation returned by the service.
- See Also:
-
updateLogAnomalyDetector
default UpdateLogAnomalyDetectorResponse updateLogAnomalyDetector(Consumer<UpdateLogAnomalyDetectorRequest.Builder> updateLogAnomalyDetectorRequest) throws InvalidParameterException, ResourceNotFoundException, ServiceUnavailableException, OperationAbortedException, AwsServiceException, SdkClientException, CloudWatchLogsException Updates an existing log anomaly detector.
This is a convenience which creates an instance of the
UpdateLogAnomalyDetectorRequest.Builderavoiding the need to create one manually viaUpdateLogAnomalyDetectorRequest.builder()- Parameters:
updateLogAnomalyDetectorRequest- AConsumerthat will call methods onUpdateLogAnomalyDetectorRequest.Builderto create a request.- Returns:
- Result of the UpdateLogAnomalyDetector operation returned by the service.
- See Also:
-
create
Create aCloudWatchLogsClientwith the region loaded from theDefaultAwsRegionProviderChainand credentials loaded from theDefaultCredentialsProvider. -
builder
Create a builder that can be used to configure and create aCloudWatchLogsClient. -
serviceMetadata
-
serviceClientConfiguration
Description copied from interface:SdkClientThe SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfiguration- Specified by:
serviceClientConfigurationin interfaceAwsClient- Specified by:
serviceClientConfigurationin interfaceSdkClient- Returns:
- SdkServiceClientConfiguration
-