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, imagine updating a current query
definition that includes log groups. If 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.
Example
Use a bare-bones client and the command you need to make an API call.
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 ofname
,queryString
, andlogGroupNames
are changed to the values that you specify in your update operation. No current values are retained from the current query definition. For example, imagine updating a current query definition that includes log groups. If you don't specify thelogGroupNames
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.Example
Use a bare-bones client and the command you need to make an API call.
Param
PutQueryDefinitionCommandInput
Returns
PutQueryDefinitionCommandOutput
See
input
shape.response
shape.config
shape.Throws
InvalidParameterException (client fault)
A parameter is specified incorrectly.
Throws
LimitExceededException (client fault)
You have reached the maximum number of resources that can be created.
Throws
ResourceNotFoundException (client fault)
The specified resource does not exist.
Throws
ServiceUnavailableException (server fault)
The service cannot complete the request.
Throws
CloudWatchLogsServiceException
Base exception class for all service exceptions from CloudWatchLogs service.