# AWS::Logs::QueryDefinition The resource schema for AWSLogs QueryDefinition ## Syntax To declare this entity in your AWS CloudFormation template, use the following syntax: ### JSON
{ "Type" : "AWS::Logs::QueryDefinition", "Properties" : { "Name" : String, "QueryString" : String, "LogGroupNames" : [ String, ... ], } }### YAML
Type: AWS::Logs::QueryDefinition Properties: Name: String QueryString: String LogGroupNames: - String## Properties #### Name A name for the saved query definition _Required_: No _Type_: String _Minimum_:
1
_Maximum_: 255
_Pattern_: ^([^:*\/]+\/?)*[^:*\/]+$
_Update requires_: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)
#### QueryString
The query string to use for this definition
_Required_: No
_Type_: String
_Minimum_: 1
_Maximum_: 10000
_Update requires_: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)
#### LogGroupNames
Optionally define specific log groups as part of your query definition
_Required_: No
_Type_: List of String
_Update requires_: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)
## Return Values
### Ref
When you pass the logical ID of this resource to the intrinsic `Ref` function, Ref returns the QueryDefinitionId.
### Fn::GetAtt
The `Fn::GetAtt` intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.
For more information about using the `Fn::GetAtt` intrinsic function, see [Fn::GetAtt](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-getatt.html).
#### QueryDefinitionId
Unique identifier of a query definition