Skip to content

get_query_results

Operation

get_query_results

get_query_results(request: GetQueryResultsInput | GetQueryResultsInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[GetQueryResultsInputDict]) -> GetQueryResultsOutput
Warning

CloudTrail Lake will no longer be open to new customers starting May 31, 2026. If you would like to use CloudTrail Lake, sign up prior to that date. Existing customers can continue to use the service as normal. For more information, see CloudTrail Lake availability change.

Gets event data results of a query. You must specify the QueryID value returned by the StartQuery operation.

Parameters:

Name Type Description Default
request GetQueryResultsInput | GetQueryResultsInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[GetQueryResultsInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
GetQueryResultsOutput

An instance of GetQueryResultsOutput.

get_query_results async

get_query_results(request: GetQueryResultsInput | GetQueryResultsInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[GetQueryResultsInputDict]) -> GetQueryResultsOutput
Warning

CloudTrail Lake will no longer be open to new customers starting May 31, 2026. If you would like to use CloudTrail Lake, sign up prior to that date. Existing customers can continue to use the service as normal. For more information, see CloudTrail Lake availability change.

Gets event data results of a query. You must specify the QueryID value returned by the StartQuery operation.

Parameters:

Name Type Description Default
request GetQueryResultsInput | GetQueryResultsInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[GetQueryResultsInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
GetQueryResultsOutput

An instance of GetQueryResultsOutput.

Input

Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.

GetQueryResultsInputDict

Bases: TypedDict

Dictionary form of GetQueryResultsInput.

Attributes

event_data_store instance-attribute
event_data_store: str | None

The ARN (or ID suffix of the ARN) of the event data store against which the query was run.

event_data_store_owner_account_id instance-attribute
event_data_store_owner_account_id: str | None

The account ID of the event data store owner.

max_query_results instance-attribute
max_query_results: int | None

The maximum number of query results to display on a single page.

next_token instance-attribute
next_token: str | None

A token you can use to get the next page of query results.

query_id instance-attribute
query_id: Required[str]

The ID of the query for which you want to get results.

GetQueryResultsInput dataclass

Bases: _SerdeShape

Dataclass for GetQueryResultsInput structure.

Attributes

event_data_store class-attribute instance-attribute
event_data_store: str | None = ...

The ARN (or ID suffix of the ARN) of the event data store against which the query was run.

event_data_store_owner_account_id class-attribute instance-attribute
event_data_store_owner_account_id: str | None = ...

The account ID of the event data store owner.

max_query_results class-attribute instance-attribute
max_query_results: int | None = ...

The maximum number of query results to display on a single page.

next_token class-attribute instance-attribute
next_token: str | None = ...

A token you can use to get the next page of query results.

query_id class-attribute instance-attribute
query_id: str | None = ...

The ID of the query for which you want to get results.

Output

GetQueryResultsOutput dataclass

Bases: _SerdeShape

Dataclass for GetQueryResultsOutput structure.

Attributes

error_message class-attribute instance-attribute
error_message: str | None = ...

The error message returned if a query failed.

next_token class-attribute instance-attribute
next_token: str | None = ...

A token you can use to get the next page of query results.

query_result_rows class-attribute instance-attribute
query_result_rows: list[list[dict[str, str]]] | None = ...

Contains the individual event results of the query.

query_statistics class-attribute instance-attribute
query_statistics: QueryStatistics | None = ...

Shows the count of query results.

query_status class-attribute instance-attribute
query_status: str | None = ...

The status of the query. Values include QUEUED, RUNNING, FINISHED, FAILED, TIMED_OUT, or CANCELLED.

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.