| 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 |
Amazonka.CloudWatchLogs.GetQueryResults
Description
Returns 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.
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.
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.
Synopsis
- data GetQueryResults = GetQueryResults' {}
- newGetQueryResults :: Text -> GetQueryResults
- getQueryResults_queryId :: Lens' GetQueryResults Text
- data GetQueryResultsResponse = GetQueryResultsResponse' {
- results :: Maybe [[ResultField]]
- statistics :: Maybe QueryStatistics
- status :: Maybe QueryStatus
- httpStatus :: Int
- newGetQueryResultsResponse :: Int -> GetQueryResultsResponse
- getQueryResultsResponse_results :: Lens' GetQueryResultsResponse (Maybe [[ResultField]])
- getQueryResultsResponse_statistics :: Lens' GetQueryResultsResponse (Maybe QueryStatistics)
- getQueryResultsResponse_status :: Lens' GetQueryResultsResponse (Maybe QueryStatus)
- getQueryResultsResponse_httpStatus :: Lens' GetQueryResultsResponse Int
Creating a Request
data GetQueryResults Source #
See: newGetQueryResults smart constructor.
Constructors
| GetQueryResults' | |
Instances
Arguments
| :: Text | |
| -> GetQueryResults |
Create a value of GetQueryResults 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:
GetQueryResults, getQueryResults_queryId - The ID number of the query.
Request Lenses
getQueryResults_queryId :: Lens' GetQueryResults Text Source #
The ID number of the query.
Destructuring the Response
data GetQueryResultsResponse Source #
See: newGetQueryResultsResponse smart constructor.
Constructors
| GetQueryResultsResponse' | |
Fields
| |
Instances
newGetQueryResultsResponse Source #
Create a value of GetQueryResultsResponse 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:results:GetQueryResultsResponse', getQueryResultsResponse_results - 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.
$sel:statistics:GetQueryResultsResponse', getQueryResultsResponse_statistics - 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 log events that were scanned. These values reflect the full
raw results of the query.
GetQueryResultsResponse, getQueryResultsResponse_status - 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 15 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.
$sel:httpStatus:GetQueryResultsResponse', getQueryResultsResponse_httpStatus - The response's http status code.
Response Lenses
getQueryResultsResponse_results :: Lens' GetQueryResultsResponse (Maybe [[ResultField]]) Source #
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.
getQueryResultsResponse_statistics :: Lens' GetQueryResultsResponse (Maybe QueryStatistics) Source #
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 log events that were scanned. These values reflect the full raw results of the query.
getQueryResultsResponse_status :: Lens' GetQueryResultsResponse (Maybe QueryStatus) Source #
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 15 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.
getQueryResultsResponse_httpStatus :: Lens' GetQueryResultsResponse Int Source #
The response's http status code.