Class QueryDefinition
Define a query definition for CloudWatch Logs Insights.
Inherited Members
Namespace: Amazon.CDK.AWS.Logs
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class QueryDefinition : Resource, IResource, IConstruct, IDependable
Syntax (vb)
Public Class QueryDefinition Inherits Resource Implements IResource, IConstruct, IDependable
Remarks
ExampleMetadata: infused
Examples
new QueryDefinition(this, "QueryDefinition", new QueryDefinitionProps {
QueryDefinitionName = "MyQuery",
QueryString = new QueryString(new QueryStringProps {
Fields = new [] { "@timestamp", "@message" },
ParseStatements = new [] { "@message \"[*] *\" as loggingType, loggingMessage", "@message \"<*>: *\" as differentLoggingType, differentLoggingMessage" },
FilterStatements = new [] { "loggingType = \"ERROR\"", "loggingMessage = \"A very strange error occurred!\"" },
Sort = "@timestamp desc",
Limit = 20
})
});
Synopsis
Constructors
QueryDefinition(Construct, string, IQueryDefinitionProps) | Define a query definition for CloudWatch Logs Insights. |
Properties
PROPERTY_INJECTION_ID | Uniquely identifies this class. |
QueryDefinitionId | The ID of the query definition. |
Constructors
QueryDefinition(Construct, string, IQueryDefinitionProps)
Define a query definition for CloudWatch Logs Insights.
public QueryDefinition(Construct scope, string id, IQueryDefinitionProps props)
Parameters
- scope Construct
- id string
- props IQueryDefinitionProps
Remarks
ExampleMetadata: infused
Examples
new QueryDefinition(this, "QueryDefinition", new QueryDefinitionProps {
QueryDefinitionName = "MyQuery",
QueryString = new QueryString(new QueryStringProps {
Fields = new [] { "@timestamp", "@message" },
ParseStatements = new [] { "@message \"[*] *\" as loggingType, loggingMessage", "@message \"<*>: *\" as differentLoggingType, differentLoggingMessage" },
FilterStatements = new [] { "loggingType = \"ERROR\"", "loggingMessage = \"A very strange error occurred!\"" },
Sort = "@timestamp desc",
Limit = 20
})
});
Properties
PROPERTY_INJECTION_ID
Uniquely identifies this class.
public static string PROPERTY_INJECTION_ID { get; }
Property Value
Remarks
ExampleMetadata: infused
QueryDefinitionId
The ID of the query definition.
public virtual string QueryDefinitionId { get; }
Property Value
Remarks
Attribute: true
Implements
Constructs.IConstruct
Constructs.IDependable