amazonka-cloudwatch-logs-2.0: Amazon CloudWatch Logs SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.CloudWatchLogs.FilterLogEvents

Description

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;FilterLogEvents permission to perform this operation.

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 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.

This operation returns paginated results.

Synopsis

Creating a Request

data FilterLogEvents Source #

See: newFilterLogEvents smart constructor.

Constructors

FilterLogEvents' 

Fields

  • endTime :: Maybe Natural

    The end of the time range, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a timestamp later than this time are not returned.

  • filterPattern :: Maybe Text

    The filter pattern to use. For more information, see Filter and Pattern Syntax.

    If not provided, all the events are matched.

  • interleaved :: Maybe Bool

    If the value is true, the operation attempts to provide responses that contain events from multiple log streams within the log group, interleaved in a single response. If the value is false, all the matched log events in the first log stream are searched first, then those in the next log stream, and so on.

    Important As of June 17, 2019, this parameter is ignored and the value is assumed to be true. The response from this operation always interleaves events from multiple log streams within a log group.

  • limit :: Maybe Natural

    The maximum number of events to return. The default is 10,000 events.

  • logGroupIdentifier :: Maybe Text

    Specify either the name or ARN of the log group to view log events from. If the log group is in a source account and you are using a monitoring account, you must use the log group ARN.

    If you specify values for both logGroupName and logGroupIdentifier, the action returns an InvalidParameterException error.

  • logStreamNamePrefix :: Maybe Text

    Filters the results to include only events from log streams that have names starting with this prefix.

    If you specify a value for both logStreamNamePrefix and logStreamNames, but the value for logStreamNamePrefix does not match any log stream names specified in logStreamNames, the action returns an InvalidParameterException error.

  • logStreamNames :: Maybe (NonEmpty Text)

    Filters the results to only logs from the log streams in this list.

    If you specify a value for both logStreamNamePrefix and logStreamNames, the action returns an InvalidParameterException error.

  • nextToken :: Maybe Text

    The token for the next set of events to return. (You received this token from a previous call.)

  • startTime :: Maybe Natural

    The start of the time range, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a timestamp before this time are not returned.

  • unmask :: Maybe Bool

    Specify true to display the log event fields with all sensitive data unmasked and visible. The default is false.

    To use this operation with this parameter, you must be signed into an account with the logs:Unmask permission.

  • logGroupName :: Text

    The name of the log group to search.

    If you specify values for both logGroupName and logGroupIdentifier, the action returns an InvalidParameterException error.

Instances

Instances details
ToJSON FilterLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.FilterLogEvents

ToHeaders FilterLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.FilterLogEvents

ToPath FilterLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.FilterLogEvents

ToQuery FilterLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.FilterLogEvents

AWSPager FilterLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.FilterLogEvents

AWSRequest FilterLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.FilterLogEvents

Associated Types

type AWSResponse FilterLogEvents #

Generic FilterLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.FilterLogEvents

Associated Types

type Rep FilterLogEvents :: Type -> Type #

Read FilterLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.FilterLogEvents

Show FilterLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.FilterLogEvents

NFData FilterLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.FilterLogEvents

Methods

rnf :: FilterLogEvents -> () #

Eq FilterLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.FilterLogEvents

Hashable FilterLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.FilterLogEvents

type AWSResponse FilterLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.FilterLogEvents

type Rep FilterLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.FilterLogEvents

type Rep FilterLogEvents = D1 ('MetaData "FilterLogEvents" "Amazonka.CloudWatchLogs.FilterLogEvents" "amazonka-cloudwatch-logs-2.0-6gvDalNFsfE8djZ4aTfA4V" 'False) (C1 ('MetaCons "FilterLogEvents'" 'PrefixI 'True) (((S1 ('MetaSel ('Just "endTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Natural)) :*: S1 ('MetaSel ('Just "filterPattern") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "interleaved") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool)) :*: (S1 ('MetaSel ('Just "limit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Natural)) :*: S1 ('MetaSel ('Just "logGroupIdentifier") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))))) :*: ((S1 ('MetaSel ('Just "logStreamNamePrefix") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "logStreamNames") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (NonEmpty Text))) :*: S1 ('MetaSel ('Just "nextToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)))) :*: (S1 ('MetaSel ('Just "startTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Natural)) :*: (S1 ('MetaSel ('Just "unmask") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "logGroupName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text))))))

newFilterLogEvents Source #

Create a value of FilterLogEvents with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:endTime:FilterLogEvents', filterLogEvents_endTime - The end of the time range, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a timestamp later than this time are not returned.

FilterLogEvents, filterLogEvents_filterPattern - The filter pattern to use. For more information, see Filter and Pattern Syntax.

If not provided, all the events are matched.

$sel:interleaved:FilterLogEvents', filterLogEvents_interleaved - If the value is true, the operation attempts to provide responses that contain events from multiple log streams within the log group, interleaved in a single response. If the value is false, all the matched log events in the first log stream are searched first, then those in the next log stream, and so on.

Important As of June 17, 2019, this parameter is ignored and the value is assumed to be true. The response from this operation always interleaves events from multiple log streams within a log group.

$sel:limit:FilterLogEvents', filterLogEvents_limit - The maximum number of events to return. The default is 10,000 events.

$sel:logGroupIdentifier:FilterLogEvents', filterLogEvents_logGroupIdentifier - Specify either the name or ARN of the log group to view log events from. If the log group is in a source account and you are using a monitoring account, you must use the log group ARN.

If you specify values for both logGroupName and logGroupIdentifier, the action returns an InvalidParameterException error.

$sel:logStreamNamePrefix:FilterLogEvents', filterLogEvents_logStreamNamePrefix - Filters the results to include only events from log streams that have names starting with this prefix.

If you specify a value for both logStreamNamePrefix and logStreamNames, but the value for logStreamNamePrefix does not match any log stream names specified in logStreamNames, the action returns an InvalidParameterException error.

$sel:logStreamNames:FilterLogEvents', filterLogEvents_logStreamNames - Filters the results to only logs from the log streams in this list.

If you specify a value for both logStreamNamePrefix and logStreamNames, the action returns an InvalidParameterException error.

FilterLogEvents, filterLogEvents_nextToken - The token for the next set of events to return. (You received this token from a previous call.)

$sel:startTime:FilterLogEvents', filterLogEvents_startTime - The start of the time range, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a timestamp before this time are not returned.

$sel:unmask:FilterLogEvents', filterLogEvents_unmask - Specify true to display the log event fields with all sensitive data unmasked and visible. The default is false.

To use this operation with this parameter, you must be signed into an account with the logs:Unmask permission.

FilterLogEvents, filterLogEvents_logGroupName - The name of the log group to search.

If you specify values for both logGroupName and logGroupIdentifier, the action returns an InvalidParameterException error.

Request Lenses

filterLogEvents_endTime :: Lens' FilterLogEvents (Maybe Natural) Source #

The end of the time range, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a timestamp later than this time are not returned.

filterLogEvents_filterPattern :: Lens' FilterLogEvents (Maybe Text) Source #

The filter pattern to use. For more information, see Filter and Pattern Syntax.

If not provided, all the events are matched.

filterLogEvents_interleaved :: Lens' FilterLogEvents (Maybe Bool) Source #

If the value is true, the operation attempts to provide responses that contain events from multiple log streams within the log group, interleaved in a single response. If the value is false, all the matched log events in the first log stream are searched first, then those in the next log stream, and so on.

Important As of June 17, 2019, this parameter is ignored and the value is assumed to be true. The response from this operation always interleaves events from multiple log streams within a log group.

filterLogEvents_limit :: Lens' FilterLogEvents (Maybe Natural) Source #

The maximum number of events to return. The default is 10,000 events.

filterLogEvents_logGroupIdentifier :: Lens' FilterLogEvents (Maybe Text) Source #

Specify either the name or ARN of the log group to view log events from. If the log group is in a source account and you are using a monitoring account, you must use the log group ARN.

If you specify values for both logGroupName and logGroupIdentifier, the action returns an InvalidParameterException error.

filterLogEvents_logStreamNamePrefix :: Lens' FilterLogEvents (Maybe Text) Source #

Filters the results to include only events from log streams that have names starting with this prefix.

If you specify a value for both logStreamNamePrefix and logStreamNames, but the value for logStreamNamePrefix does not match any log stream names specified in logStreamNames, the action returns an InvalidParameterException error.

filterLogEvents_logStreamNames :: Lens' FilterLogEvents (Maybe (NonEmpty Text)) Source #

Filters the results to only logs from the log streams in this list.

If you specify a value for both logStreamNamePrefix and logStreamNames, the action returns an InvalidParameterException error.

filterLogEvents_nextToken :: Lens' FilterLogEvents (Maybe Text) Source #

The token for the next set of events to return. (You received this token from a previous call.)

filterLogEvents_startTime :: Lens' FilterLogEvents (Maybe Natural) Source #

The start of the time range, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a timestamp before this time are not returned.

filterLogEvents_unmask :: Lens' FilterLogEvents (Maybe Bool) Source #

Specify true to display the log event fields with all sensitive data unmasked and visible. The default is false.

To use this operation with this parameter, you must be signed into an account with the logs:Unmask permission.

filterLogEvents_logGroupName :: Lens' FilterLogEvents Text Source #

The name of the log group to search.

If you specify values for both logGroupName and logGroupIdentifier, the action returns an InvalidParameterException error.

Destructuring the Response

data FilterLogEventsResponse Source #

See: newFilterLogEventsResponse smart constructor.

Constructors

FilterLogEventsResponse' 

Fields

Instances

Instances details
Generic FilterLogEventsResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.FilterLogEvents

Associated Types

type Rep FilterLogEventsResponse :: Type -> Type #

Read FilterLogEventsResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.FilterLogEvents

Show FilterLogEventsResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.FilterLogEvents

NFData FilterLogEventsResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.FilterLogEvents

Methods

rnf :: FilterLogEventsResponse -> () #

Eq FilterLogEventsResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.FilterLogEvents

type Rep FilterLogEventsResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.FilterLogEvents

type Rep FilterLogEventsResponse = D1 ('MetaData "FilterLogEventsResponse" "Amazonka.CloudWatchLogs.FilterLogEvents" "amazonka-cloudwatch-logs-2.0-6gvDalNFsfE8djZ4aTfA4V" 'False) (C1 ('MetaCons "FilterLogEventsResponse'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "events") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [FilteredLogEvent])) :*: S1 ('MetaSel ('Just "nextToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "searchedLogStreams") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [SearchedLogStream])) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))))

newFilterLogEventsResponse Source #

Create a value of FilterLogEventsResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:events:FilterLogEventsResponse', filterLogEventsResponse_events - The matched events.

FilterLogEvents, filterLogEventsResponse_nextToken - The token to use when requesting the next set of items. The token expires after 24 hours.

$sel:searchedLogStreams:FilterLogEventsResponse', filterLogEventsResponse_searchedLogStreams - Important As of May 15, 2020, this parameter is no longer supported. This parameter returns an empty list.

Indicates which log streams have been searched and whether each has been searched completely.

$sel:httpStatus:FilterLogEventsResponse', filterLogEventsResponse_httpStatus - The response's http status code.

Response Lenses

filterLogEventsResponse_nextToken :: Lens' FilterLogEventsResponse (Maybe Text) Source #

The token to use when requesting the next set of items. The token expires after 24 hours.

filterLogEventsResponse_searchedLogStreams :: Lens' FilterLogEventsResponse (Maybe [SearchedLogStream]) Source #

Important As of May 15, 2020, this parameter is no longer supported. This parameter returns an empty list.

Indicates which log streams have been searched and whether each has been searched completely.