libZSservicesZSamazonka-cloudwatch-logsZSamazonka-cloudwatch-logs
Copyright(c) 2013-2021 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone

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.

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 time range that you specify. If the results include a token, then there are more log events available, and 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.

This operation returns paginated results.

Synopsis

Creating a Request

data FilterLogEvents Source #

See: newFilterLogEvents smart constructor.

Constructors

FilterLogEvents' 

Fields

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

  • nextToken :: Maybe Text

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

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

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

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

  • limit :: Maybe Natural

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

  • 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 makes a best effort 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. The default is false.

    Important: Starting on 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.

  • logGroupName :: Text

    The name of the log group to search.

Instances

Instances details
Eq FilterLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.FilterLogEvents

Read FilterLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.FilterLogEvents

Show FilterLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.FilterLogEvents

Generic FilterLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.FilterLogEvents

Associated Types

type Rep FilterLogEvents :: Type -> Type #

NFData FilterLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.FilterLogEvents

Methods

rnf :: FilterLogEvents -> () #

Hashable FilterLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.FilterLogEvents

ToJSON 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 #

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

type Rep FilterLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.FilterLogEvents

type AWSResponse FilterLogEvents Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.FilterLogEvents

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: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:nextToken:FilterLogEvents', filterLogEvents_nextToken - The token for the next set of events to return. (You received this token from a previous call.)

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

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

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

$sel:filterPattern: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 makes a best effort 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. The default is false.

Important: Starting on 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:logGroupName:FilterLogEvents', filterLogEvents_logGroupName - The name of the log group to search.

Request Lenses

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_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_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_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_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_limit :: Lens' FilterLogEvents (Maybe Natural) Source #

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

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 makes a best effort 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. The default is false.

Important: Starting on 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_logGroupName :: Lens' FilterLogEvents Text Source #

The name of the log group to search.

Destructuring the Response

data FilterLogEventsResponse Source #

See: newFilterLogEventsResponse smart constructor.

Constructors

FilterLogEventsResponse' 

Fields

  • searchedLogStreams :: Maybe [SearchedLogStream]

    IMPORTANT Starting on May 15, 2020, this parameter will be deprecated. This parameter will be an empty list after the deprecation occurs.

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

  • nextToken :: Maybe Text

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

  • events :: Maybe [FilteredLogEvent]

    The matched events.

  • httpStatus :: Int

    The response's http status code.

Instances

Instances details
Eq FilterLogEventsResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.FilterLogEvents

Read FilterLogEventsResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.FilterLogEvents

Show FilterLogEventsResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.FilterLogEvents

Generic FilterLogEventsResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.FilterLogEvents

Associated Types

type Rep FilterLogEventsResponse :: Type -> Type #

NFData FilterLogEventsResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.FilterLogEvents

Methods

rnf :: FilterLogEventsResponse -> () #

type Rep FilterLogEventsResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.FilterLogEvents

type Rep FilterLogEventsResponse = D1 ('MetaData "FilterLogEventsResponse" "Amazonka.CloudWatchLogs.FilterLogEvents" "libZSservicesZSamazonka-cloudwatch-logsZSamazonka-cloudwatch-logs" 'False) (C1 ('MetaCons "FilterLogEventsResponse'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "searchedLogStreams") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [SearchedLogStream])) :*: S1 ('MetaSel ('Just "nextToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "events") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [FilteredLogEvent])) :*: 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:searchedLogStreams:FilterLogEventsResponse', filterLogEventsResponse_searchedLogStreams - IMPORTANT Starting on May 15, 2020, this parameter will be deprecated. This parameter will be an empty list after the deprecation occurs.

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

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

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

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

Response Lenses

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

IMPORTANT Starting on May 15, 2020, this parameter will be deprecated. This parameter will be an empty list after the deprecation occurs.

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

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

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