AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Lists log events from the specified log group. You can list all the log events or filter the results using one or more of the following:

You must have the logs:FilterLogEvents permission to perform this operation.

You can specify the log group to search by using either logGroupIdentifier or logGroupName. You must include one of these two parameters, but you can't include both.

FilterLogEvents is a paginated operation. Each page returned can contain up to 1 MB of log events or up to 10,000 log events. A returned page might only be partially full, or even empty. For example, if the result of a query would return 15,000 log events, the first page isn't guaranteed to have 10,000 log events even if they all fit into 1 MB.

Partially full or empty pages don't necessarily mean that pagination is finished. If the results include a nextToken, there might be more log events available. You can return these additional log events by providing the nextToken in a subsequent FilterLogEvents operation. If the results don't include a nextToken, then pagination is finished.

Specifying the limit parameter only guarantees that a single page doesn't return more log events than the specified limit, but it might return fewer events than the limit. This is the expected API behavior.

The returned log events are sorted by event timestamp, the timestamp when the event was ingested by CloudWatch Logs, and the ID of the PutLogEvents request.

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.

If you are using log transformation, the FilterLogEvents operation returns only the original versions of log events, before they were transformed. To view the transformed versions, you must use a CloudWatch Logs query.

Note:

For .NET Core this operation is only available in asynchronous form. Please refer to FilterLogEventsAsync.

Namespace: Amazon.CloudWatchLogs
Assembly: AWSSDK.CloudWatchLogs.dll
Version: 3.x.y.z

Syntax

C#
public virtual FilterLogEventsResponse FilterLogEvents(
         FilterLogEventsRequest request
)

Parameters

request
Type: Amazon.CloudWatchLogs.Model.FilterLogEventsRequest

Container for the necessary parameters to execute the FilterLogEvents service method.

Return Value


The response from the FilterLogEvents service method, as returned by CloudWatchLogs.

Exceptions

ExceptionCondition
InvalidParameterException A parameter is specified incorrectly.
ResourceNotFoundException The specified resource does not exist.
ServiceUnavailableException The service cannot complete the request.

Version Information

.NET Framework:
Supported in: 4.5 and newer, 3.5

See Also