Values.GetQueryResultsResponseSourceReturns the results from the specified query. Only the fields requested in the query are returned, along with a @ptr field, which is the identifier for the log record. You can use the value of @ptr in a GetLogRecord operation to get the full log record. GetQueryResults does not start running a query. To run a query, use StartQuery. For more information about how long results of previous queries are available, see CloudWatch Logs quotas. If the value of the Status field in the output is Running, this operation returns only partial results. If you see a value of Scheduled or Running for the status, you can retry the operation later to see the final results. This operation is used both for retrieving results from interactive queries and from automated scheduled query executions. Scheduled queries use GetQueryResults internally to retrieve query results for processing and delivery to configured destinations. You can retrieve up to 100,000 log event results from a query, if available, by using pagination. Use the nextToken returned in the response to request additional pages of results, with each page returning up to 10,000 log events. If you are using CloudWatch cross-account observability, you can use this operation in a monitoring account to start queries in linked source accounts. For more information, see CloudWatch cross-account observability.
type nonrec t = {queryLanguage : QueryLanguage.t option;The query language used for this query. For more information about the query languages that CloudWatch Logs supports, see Supported query languages.
*)results : QueryResults.t option;The log events that matched the query criteria during the most recent time it ran. The results value is an array of arrays. Each log event is one object in the top-level array. Each of these log event objects is an array of field/value pairs.
*)statistics : QueryStatistics.t option;Includes the number of log events scanned by the query, the number of log events that matched the query criteria, and the total number of bytes in the scanned log events. These values reflect the full raw results of the query.
*)status : QueryStatus.t option;The status of the most recent running of the query. Possible values are Cancelled, Complete, Failed, Running, Scheduled, Timeout, and Unknown. Queries time out after 60 minutes of runtime. To avoid having your queries time out, reduce the time range being searched or partition your query into a number of queries.
*)encryptionKey : EncryptionKey.t option;If you associated an KMS key with the CloudWatch Logs Insights query results in this account, this field displays the ARN of the key that's used to encrypt the query results when StartQuery stores them.
*)nextToken : GetQueryResultsNextToken.t option;If there are more log events remaining in the results, the response includes a nextToken. You can use this token in a subsequent GetQueryResults request to get the next set of results. You can retrieve up to 100,000 log event results from a query by paginating with this token.
*)}type nonrec error = [ | `InvalidParameterException of InvalidParameterException.t| `ResourceNotFoundException of ResourceNotFoundException.t| `Unknown_operation_error of string * string option ]val error_of_json :
string ->
Yojson.Safe.t ->
[> `InvalidParameterException of unit
| `ResourceNotFoundException of unit
| `ServiceUnavailableException of unit
| `Unknown_operation_error of string * string option ]val error_of_xml :
string ->
Awso.Xml.t ->
[> `InvalidParameterException of unit
| `ResourceNotFoundException of unit
| `ServiceUnavailableException of unit
| `Unknown_operation_error of string * string option ]val to_value :
t ->
[> `Structure of
(string
* [> `Enum of string
| `List of
[> `List of
[> `Structure of (string * [> `String of Field.t ]) list ]
list ]
list
| `String of EncryptionKey.t
| `Structure of (string * [> `Double of StatsValue.t ]) list ])
list ]