CloudTrail / Client / get_query_results
get_query_results#
- CloudTrail.Client.get_query_results(**kwargs)#
Gets event data results of a query. You must specify the
QueryID
value returned by theStartQuery
operation.See also: AWS API Documentation
Request Syntax
response = client.get_query_results( EventDataStore='string', QueryId='string', NextToken='string', MaxQueryResults=123 )
- Parameters:
EventDataStore (string) – The ARN (or ID suffix of the ARN) of the event data store against which the query was run.
QueryId (string) –
[REQUIRED]
The ID of the query for which you want to get results.
NextToken (string) – A token you can use to get the next page of query results.
MaxQueryResults (integer) – The maximum number of query results to display on a single page.
- Return type:
dict
- Returns:
Response Syntax
{ 'QueryStatus': 'QUEUED'|'RUNNING'|'FINISHED'|'FAILED'|'CANCELLED'|'TIMED_OUT', 'QueryStatistics': { 'ResultsCount': 123, 'TotalResultsCount': 123, 'BytesScanned': 123 }, 'QueryResultRows': [ [ { 'string': 'string' }, ], ], 'NextToken': 'string', 'ErrorMessage': 'string' }
Response Structure
(dict) –
QueryStatus (string) –
The status of the query. Values include
QUEUED
,RUNNING
,FINISHED
,FAILED
,TIMED_OUT
, orCANCELLED
.QueryStatistics (dict) –
Shows the count of query results.
ResultsCount (integer) –
The number of results returned.
TotalResultsCount (integer) –
The total number of results returned by a query.
BytesScanned (integer) –
The total bytes that the query scanned in the event data store. This value matches the number of bytes for which your account is billed for the query, unless the query is still running.
QueryResultRows (list) –
Contains the individual event results of the query.
(list) –
(dict) –
(string) –
(string) –
NextToken (string) –
A token you can use to get the next page of query results.
ErrorMessage (string) –
The error message returned if a query failed.
Exceptions
CloudTrail.Client.exceptions.EventDataStoreARNInvalidException
CloudTrail.Client.exceptions.EventDataStoreNotFoundException
CloudTrail.Client.exceptions.InactiveEventDataStoreException
CloudTrail.Client.exceptions.InsufficientEncryptionPolicyException
CloudTrail.Client.exceptions.NoManagementAccountSLRExistsException