amazonka-cloudwatch-logs-2.0: Amazon CloudWatch Logs SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

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

Creating a Request

data GetQueryResults Source #

See: newGetQueryResults smart constructor.

Constructors

GetQueryResults' 

Fields

Instances

Instances details
ToJSON GetQueryResults Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.GetQueryResults

ToHeaders GetQueryResults Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.GetQueryResults

ToPath GetQueryResults Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.GetQueryResults

ToQuery GetQueryResults Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.GetQueryResults

AWSRequest GetQueryResults Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.GetQueryResults

Associated Types

type AWSResponse GetQueryResults #

Generic GetQueryResults Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.GetQueryResults

Associated Types

type Rep GetQueryResults :: Type -> Type #

Read GetQueryResults Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.GetQueryResults

Show GetQueryResults Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.GetQueryResults

NFData GetQueryResults Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.GetQueryResults

Methods

rnf :: GetQueryResults -> () #

Eq GetQueryResults Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.GetQueryResults

Hashable GetQueryResults Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.GetQueryResults

type AWSResponse GetQueryResults Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.GetQueryResults

type Rep GetQueryResults Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.GetQueryResults

type Rep GetQueryResults = D1 ('MetaData "GetQueryResults" "Amazonka.CloudWatchLogs.GetQueryResults" "amazonka-cloudwatch-logs-2.0-6gvDalNFsfE8djZ4aTfA4V" 'False) (C1 ('MetaCons "GetQueryResults'" 'PrefixI 'True) (S1 ('MetaSel ('Just "queryId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)))

newGetQueryResults Source #

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

Destructuring the Response

data GetQueryResultsResponse Source #

See: newGetQueryResultsResponse smart constructor.

Constructors

GetQueryResultsResponse' 

Fields

  • results :: Maybe [[ResultField]]

    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 :: Maybe QueryStatistics

    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.

  • status :: Maybe QueryStatus

    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.

  • httpStatus :: Int

    The response's http status code.

Instances

Instances details
Generic GetQueryResultsResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.GetQueryResults

Associated Types

type Rep GetQueryResultsResponse :: Type -> Type #

Read GetQueryResultsResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.GetQueryResults

Show GetQueryResultsResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.GetQueryResults

NFData GetQueryResultsResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.GetQueryResults

Methods

rnf :: GetQueryResultsResponse -> () #

Eq GetQueryResultsResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.GetQueryResults

type Rep GetQueryResultsResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.GetQueryResults

type Rep GetQueryResultsResponse = D1 ('MetaData "GetQueryResultsResponse" "Amazonka.CloudWatchLogs.GetQueryResults" "amazonka-cloudwatch-logs-2.0-6gvDalNFsfE8djZ4aTfA4V" 'False) (C1 ('MetaCons "GetQueryResultsResponse'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "results") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [[ResultField]])) :*: S1 ('MetaSel ('Just "statistics") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe QueryStatistics))) :*: (S1 ('MetaSel ('Just "status") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe QueryStatus)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))))

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.