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.StartQuery

Description

Schedules a query of a log group using CloudWatch Logs Insights. You specify the log group and time range to query and the query string to use.

For more information, see CloudWatch Logs Insights Query Syntax.

Queries time out after 15 minutes of runtime. If your queries are timing out, reduce the time range being searched or partition your query into a number of queries.

If you are using CloudWatch cross-account observability, you can use this operation in a monitoring account to start a query in a linked source account. For more information, see CloudWatch cross-account observability. For a cross-account StartQuery operation, the query definition must be defined in the monitoring account.

You can have up to 20 concurrent CloudWatch Logs insights queries, including queries that have been added to dashboards.

Synopsis

Creating a Request

data StartQuery Source #

See: newStartQuery smart constructor.

Constructors

StartQuery' 

Fields

  • limit :: Maybe Natural

    The maximum number of log events to return in the query. If the query string uses the fields command, only the specified fields and their values are returned. The default is 1000.

  • logGroupIdentifiers :: Maybe [Text]

    The list of log groups to query. You can include up to 50 log groups.

    You can specify them by the log group name or ARN. If a log group that you're querying is in a source account and you're using a monitoring account, you must specify the ARN of the log group here. The query definition must also be defined in the monitoring account.

    If you specify an ARN, the ARN can't end with an asterisk (*).

    A StartQuery operation must include exactly one of the following parameters: logGroupName, logGroupNames or logGroupIdentifiers.

  • logGroupName :: Maybe Text

    The log group on which to perform the query.

    A StartQuery operation must include exactly one of the following parameters: logGroupName, logGroupNames or logGroupIdentifiers.

  • logGroupNames :: Maybe [Text]

    The list of log groups to be queried. You can include up to 50 log groups.

    A StartQuery operation must include exactly one of the following parameters: logGroupName, logGroupNames or logGroupIdentifiers.

  • startTime :: Natural

    The beginning of the time range to query. The range is inclusive, so the specified start time is included in the query. Specified as epoch time, the number of seconds since January 1, 1970, 00:00:00 UTC.

  • endTime :: Natural

    The end of the time range to query. The range is inclusive, so the specified end time is included in the query. Specified as epoch time, the number of seconds since January 1, 1970, 00:00:00 UTC.

  • queryString :: Text

    The query string to use. For more information, see CloudWatch Logs Insights Query Syntax.

Instances

Instances details
ToJSON StartQuery Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.StartQuery

ToHeaders StartQuery Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.StartQuery

Methods

toHeaders :: StartQuery -> [Header] #

ToPath StartQuery Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.StartQuery

ToQuery StartQuery Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.StartQuery

AWSRequest StartQuery Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.StartQuery

Associated Types

type AWSResponse StartQuery #

Generic StartQuery Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.StartQuery

Associated Types

type Rep StartQuery :: Type -> Type #

Read StartQuery Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.StartQuery

Show StartQuery Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.StartQuery

NFData StartQuery Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.StartQuery

Methods

rnf :: StartQuery -> () #

Eq StartQuery Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.StartQuery

Hashable StartQuery Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.StartQuery

type AWSResponse StartQuery Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.StartQuery

type Rep StartQuery Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.StartQuery

type Rep StartQuery = D1 ('MetaData "StartQuery" "Amazonka.CloudWatchLogs.StartQuery" "amazonka-cloudwatch-logs-2.0-6gvDalNFsfE8djZ4aTfA4V" 'False) (C1 ('MetaCons "StartQuery'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "limit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Natural)) :*: (S1 ('MetaSel ('Just "logGroupIdentifiers") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Text])) :*: S1 ('MetaSel ('Just "logGroupName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)))) :*: ((S1 ('MetaSel ('Just "logGroupNames") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Text])) :*: S1 ('MetaSel ('Just "startTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Natural)) :*: (S1 ('MetaSel ('Just "endTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Natural) :*: S1 ('MetaSel ('Just "queryString") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)))))

newStartQuery Source #

Create a value of StartQuery 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:limit:StartQuery', startQuery_limit - The maximum number of log events to return in the query. If the query string uses the fields command, only the specified fields and their values are returned. The default is 1000.

$sel:logGroupIdentifiers:StartQuery', startQuery_logGroupIdentifiers - The list of log groups to query. You can include up to 50 log groups.

You can specify them by the log group name or ARN. If a log group that you're querying is in a source account and you're using a monitoring account, you must specify the ARN of the log group here. The query definition must also be defined in the monitoring account.

If you specify an ARN, the ARN can't end with an asterisk (*).

A StartQuery operation must include exactly one of the following parameters: logGroupName, logGroupNames or logGroupIdentifiers.

StartQuery, startQuery_logGroupName - The log group on which to perform the query.

A StartQuery operation must include exactly one of the following parameters: logGroupName, logGroupNames or logGroupIdentifiers.

StartQuery, startQuery_logGroupNames - The list of log groups to be queried. You can include up to 50 log groups.

A StartQuery operation must include exactly one of the following parameters: logGroupName, logGroupNames or logGroupIdentifiers.

$sel:startTime:StartQuery', startQuery_startTime - The beginning of the time range to query. The range is inclusive, so the specified start time is included in the query. Specified as epoch time, the number of seconds since January 1, 1970, 00:00:00 UTC.

$sel:endTime:StartQuery', startQuery_endTime - The end of the time range to query. The range is inclusive, so the specified end time is included in the query. Specified as epoch time, the number of seconds since January 1, 1970, 00:00:00 UTC.

StartQuery, startQuery_queryString - The query string to use. For more information, see CloudWatch Logs Insights Query Syntax.

Request Lenses

startQuery_limit :: Lens' StartQuery (Maybe Natural) Source #

The maximum number of log events to return in the query. If the query string uses the fields command, only the specified fields and their values are returned. The default is 1000.

startQuery_logGroupIdentifiers :: Lens' StartQuery (Maybe [Text]) Source #

The list of log groups to query. You can include up to 50 log groups.

You can specify them by the log group name or ARN. If a log group that you're querying is in a source account and you're using a monitoring account, you must specify the ARN of the log group here. The query definition must also be defined in the monitoring account.

If you specify an ARN, the ARN can't end with an asterisk (*).

A StartQuery operation must include exactly one of the following parameters: logGroupName, logGroupNames or logGroupIdentifiers.

startQuery_logGroupName :: Lens' StartQuery (Maybe Text) Source #

The log group on which to perform the query.

A StartQuery operation must include exactly one of the following parameters: logGroupName, logGroupNames or logGroupIdentifiers.

startQuery_logGroupNames :: Lens' StartQuery (Maybe [Text]) Source #

The list of log groups to be queried. You can include up to 50 log groups.

A StartQuery operation must include exactly one of the following parameters: logGroupName, logGroupNames or logGroupIdentifiers.

startQuery_startTime :: Lens' StartQuery Natural Source #

The beginning of the time range to query. The range is inclusive, so the specified start time is included in the query. Specified as epoch time, the number of seconds since January 1, 1970, 00:00:00 UTC.

startQuery_endTime :: Lens' StartQuery Natural Source #

The end of the time range to query. The range is inclusive, so the specified end time is included in the query. Specified as epoch time, the number of seconds since January 1, 1970, 00:00:00 UTC.

startQuery_queryString :: Lens' StartQuery Text Source #

The query string to use. For more information, see CloudWatch Logs Insights Query Syntax.

Destructuring the Response

data StartQueryResponse Source #

See: newStartQueryResponse smart constructor.

Constructors

StartQueryResponse' 

Fields

Instances

Instances details
Generic StartQueryResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.StartQuery

Associated Types

type Rep StartQueryResponse :: Type -> Type #

Read StartQueryResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.StartQuery

Show StartQueryResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.StartQuery

NFData StartQueryResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.StartQuery

Methods

rnf :: StartQueryResponse -> () #

Eq StartQueryResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.StartQuery

type Rep StartQueryResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.StartQuery

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

newStartQueryResponse Source #

Create a value of StartQueryResponse 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:

StartQueryResponse, startQueryResponse_queryId - The unique ID of the query.

$sel:httpStatus:StartQueryResponse', startQueryResponse_httpStatus - The response's http status code.

Response Lenses