Copyright | (c) 2013-2023 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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
- data FilterLogEvents = FilterLogEvents' {}
- newFilterLogEvents :: Text -> FilterLogEvents
- filterLogEvents_endTime :: Lens' FilterLogEvents (Maybe Natural)
- filterLogEvents_filterPattern :: Lens' FilterLogEvents (Maybe Text)
- filterLogEvents_interleaved :: Lens' FilterLogEvents (Maybe Bool)
- filterLogEvents_limit :: Lens' FilterLogEvents (Maybe Natural)
- filterLogEvents_logGroupIdentifier :: Lens' FilterLogEvents (Maybe Text)
- filterLogEvents_logStreamNamePrefix :: Lens' FilterLogEvents (Maybe Text)
- filterLogEvents_logStreamNames :: Lens' FilterLogEvents (Maybe (NonEmpty Text))
- filterLogEvents_nextToken :: Lens' FilterLogEvents (Maybe Text)
- filterLogEvents_startTime :: Lens' FilterLogEvents (Maybe Natural)
- filterLogEvents_unmask :: Lens' FilterLogEvents (Maybe Bool)
- filterLogEvents_logGroupName :: Lens' FilterLogEvents Text
- data FilterLogEventsResponse = FilterLogEventsResponse' {}
- newFilterLogEventsResponse :: Int -> FilterLogEventsResponse
- filterLogEventsResponse_events :: Lens' FilterLogEventsResponse (Maybe [FilteredLogEvent])
- filterLogEventsResponse_nextToken :: Lens' FilterLogEventsResponse (Maybe Text)
- filterLogEventsResponse_searchedLogStreams :: Lens' FilterLogEventsResponse (Maybe [SearchedLogStream])
- filterLogEventsResponse_httpStatus :: Lens' FilterLogEventsResponse Int
Creating a Request
data FilterLogEvents Source #
See: newFilterLogEvents
smart constructor.
FilterLogEvents' | |
|
Instances
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.
FilterLogEventsResponse' | |
|
Instances
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_events :: Lens' FilterLogEventsResponse (Maybe [FilteredLogEvent]) Source #
The matched events.
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.
filterLogEventsResponse_httpStatus :: Lens' FilterLogEventsResponse Int Source #
The response's http status code.