lookup_events
¶
lookup_events(
*,
config_overrides: Optional[CloudTrailClientConfig] = None,
lookup_attributes: Optional[LookupAttributesList] = None,
start_time: Optional[Date] = None,
end_time: Optional[Date] = None,
event_category: Optional[EventCategory] = None,
max_results: Optional[MaxResults] = None,
next_token: Optional[NextToken] = None,
) -> LookupEventsResponse
Looks up management events or CloudTrail Insights events that are captured by CloudTrail. You can look up events that occurred in a Region within the last 90 days.
LookupEvents returns recent Insights events for trails that enable Insights. To view Insights events for an event data store, you can run queries on your Insights event data store, and you can also view the Lake dashboard for Insights.
Lookup supports the following attributes for management events:
-
Amazon Web Services access key
-
Event ID
-
Event name
-
Event source
-
Read only
-
Resource name
-
Resource type
-
User name
Lookup supports the following attributes for Insights events:
-
Event ID
-
Event name
-
Event source
All attributes are optional. The default number of results returned is 50, with a maximum of 50 possible. The response includes a token that you can use to get the next page of results.
The rate of lookup requests is limited to two per second, per account, per Region. If this limit is exceeded, a throttling error occurs.
Parameters:
-
lookup_attributes(Optional[LookupAttributesList], default:None) –Contains a list of lookup attributes. Currently the list can contain only one item.
-
start_time(Optional[Date], default:None) –Specifies that only events that occur after or at the specified time are returned. If the specified start time is after the specified end time, an error is returned.
-
end_time(Optional[Date], default:None) –Specifies that only events that occur before or at the specified time are returned. If the specified end time is before the specified start time, an error is returned.
-
event_category(Optional[EventCategory], default:None) –Specifies the event category. If you do not specify an event category, events of the category are not returned in the response. For example, if you do not specify
insightas the value ofEventCategory, no Insights events are returned. -
max_results(Optional[MaxResults], default:None) –The number of events to return. Possible values are 1 through 50. The default is 50.
-
next_token(Optional[NextToken], default:None) –The token to use to get the next page of results after a previous API call. This token must be passed in with the same parameters that were specified in the original call. For example, if the original call specified an AttributeKey of 'Username' with a value of 'root', the call with NextToken should include those same parameters.
Raises:
-
InvalidEventCategoryException–Occurs if an event category that is not valid is specified as a value of
EventCategory. -
InvalidLookupAttributesException–Occurs when a lookup attribute is specified that is not valid.
-
InvalidMaxResultsException–This exception is thrown if the limit specified is not valid.
-
InvalidNextTokenException–A token that is not valid, or a token that was previously used in a request with different parameters. This exception is thrown if the token is not valid.
-
InvalidTimeRangeException–Occurs if the timestamp values are not valid. Either the start time occurs after the end time, or the time range is outside the range of possible values.
-
OperationNotPermittedException–This exception is thrown when the requested operation is not permitted.
-
UnsupportedOperationException–This exception is thrown when the requested operation is not supported.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_cloudtrail/_services/cloud_trail.py
3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 | |