libZSservicesZSamazonka-cloudwatch-logsZSamazonka-cloudwatch-logs
Copyright(c) 2013-2021 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone

Amazonka.CloudWatchLogs.PutQueryDefinition

Description

Creates or updates a query definition for CloudWatch Logs Insights. For more information, see Analyzing Log Data with CloudWatch Logs Insights.

To update a query definition, specify its queryDefinitionId in your request. The values of name, queryString, and logGroupNames are changed to the values that you specify in your update operation. No current values are retained from the current query definition. For example, if you update a current query definition that includes log groups, and you don't specify the logGroupNames parameter in your update operation, the query definition changes to contain no log groups.

You must have the logs:PutQueryDefinition permission to be able to perform this operation.

Synopsis

Creating a Request

data PutQueryDefinition Source #

See: newPutQueryDefinition smart constructor.

Constructors

PutQueryDefinition' 

Fields

  • logGroupNames :: Maybe [Text]

    Use this parameter to include specific log groups as part of your query definition.

    If you are updating a query definition and you omit this parameter, then the updated definition will contain no log groups.

  • queryDefinitionId :: Maybe Text

    If you are updating a query definition, use this parameter to specify the ID of the query definition that you want to update. You can use DescribeQueryDefinitions to retrieve the IDs of your saved query definitions.

    If you are creating a query definition, do not specify this parameter. CloudWatch generates a unique ID for the new query definition and include it in the response to this operation.

  • name :: Text

    A name for the query definition. If you are saving a lot of query definitions, we recommend that you name them so that you can easily find the ones you want by using the first part of the name as a filter in the queryDefinitionNamePrefix parameter of DescribeQueryDefinitions.

  • queryString :: Text

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

Instances

Instances details
Eq PutQueryDefinition Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.PutQueryDefinition

Read PutQueryDefinition Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.PutQueryDefinition

Show PutQueryDefinition Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.PutQueryDefinition

Generic PutQueryDefinition Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.PutQueryDefinition

Associated Types

type Rep PutQueryDefinition :: Type -> Type #

NFData PutQueryDefinition Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.PutQueryDefinition

Methods

rnf :: PutQueryDefinition -> () #

Hashable PutQueryDefinition Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.PutQueryDefinition

ToJSON PutQueryDefinition Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.PutQueryDefinition

AWSRequest PutQueryDefinition Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.PutQueryDefinition

Associated Types

type AWSResponse PutQueryDefinition #

ToHeaders PutQueryDefinition Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.PutQueryDefinition

ToPath PutQueryDefinition Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.PutQueryDefinition

ToQuery PutQueryDefinition Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.PutQueryDefinition

type Rep PutQueryDefinition Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.PutQueryDefinition

type Rep PutQueryDefinition = D1 ('MetaData "PutQueryDefinition" "Amazonka.CloudWatchLogs.PutQueryDefinition" "libZSservicesZSamazonka-cloudwatch-logsZSamazonka-cloudwatch-logs" 'False) (C1 ('MetaCons "PutQueryDefinition'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "logGroupNames") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Text])) :*: S1 ('MetaSel ('Just "queryDefinitionId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "queryString") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text))))
type AWSResponse PutQueryDefinition Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.PutQueryDefinition

newPutQueryDefinition Source #

Create a value of PutQueryDefinition 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:logGroupNames:PutQueryDefinition', putQueryDefinition_logGroupNames - Use this parameter to include specific log groups as part of your query definition.

If you are updating a query definition and you omit this parameter, then the updated definition will contain no log groups.

$sel:queryDefinitionId:PutQueryDefinition', putQueryDefinition_queryDefinitionId - If you are updating a query definition, use this parameter to specify the ID of the query definition that you want to update. You can use DescribeQueryDefinitions to retrieve the IDs of your saved query definitions.

If you are creating a query definition, do not specify this parameter. CloudWatch generates a unique ID for the new query definition and include it in the response to this operation.

$sel:name:PutQueryDefinition', putQueryDefinition_name - A name for the query definition. If you are saving a lot of query definitions, we recommend that you name them so that you can easily find the ones you want by using the first part of the name as a filter in the queryDefinitionNamePrefix parameter of DescribeQueryDefinitions.

$sel:queryString:PutQueryDefinition', putQueryDefinition_queryString - The query string to use for this definition. For more information, see CloudWatch Logs Insights Query Syntax.

Request Lenses

putQueryDefinition_logGroupNames :: Lens' PutQueryDefinition (Maybe [Text]) Source #

Use this parameter to include specific log groups as part of your query definition.

If you are updating a query definition and you omit this parameter, then the updated definition will contain no log groups.

putQueryDefinition_queryDefinitionId :: Lens' PutQueryDefinition (Maybe Text) Source #

If you are updating a query definition, use this parameter to specify the ID of the query definition that you want to update. You can use DescribeQueryDefinitions to retrieve the IDs of your saved query definitions.

If you are creating a query definition, do not specify this parameter. CloudWatch generates a unique ID for the new query definition and include it in the response to this operation.

putQueryDefinition_name :: Lens' PutQueryDefinition Text Source #

A name for the query definition. If you are saving a lot of query definitions, we recommend that you name them so that you can easily find the ones you want by using the first part of the name as a filter in the queryDefinitionNamePrefix parameter of DescribeQueryDefinitions.

putQueryDefinition_queryString :: Lens' PutQueryDefinition Text Source #

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

Destructuring the Response

data PutQueryDefinitionResponse Source #

See: newPutQueryDefinitionResponse smart constructor.

Constructors

PutQueryDefinitionResponse' 

Fields

Instances

Instances details
Eq PutQueryDefinitionResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.PutQueryDefinition

Read PutQueryDefinitionResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.PutQueryDefinition

Show PutQueryDefinitionResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.PutQueryDefinition

Generic PutQueryDefinitionResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.PutQueryDefinition

Associated Types

type Rep PutQueryDefinitionResponse :: Type -> Type #

NFData PutQueryDefinitionResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.PutQueryDefinition

type Rep PutQueryDefinitionResponse Source # 
Instance details

Defined in Amazonka.CloudWatchLogs.PutQueryDefinition

type Rep PutQueryDefinitionResponse = D1 ('MetaData "PutQueryDefinitionResponse" "Amazonka.CloudWatchLogs.PutQueryDefinition" "libZSservicesZSamazonka-cloudwatch-logsZSamazonka-cloudwatch-logs" 'False) (C1 ('MetaCons "PutQueryDefinitionResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "queryDefinitionId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))

newPutQueryDefinitionResponse Source #

Create a value of PutQueryDefinitionResponse 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:queryDefinitionId:PutQueryDefinition', putQueryDefinitionResponse_queryDefinitionId - The ID of the query definition.

$sel:httpStatus:PutQueryDefinitionResponse', putQueryDefinitionResponse_httpStatus - The response's http status code.

Response Lenses