interface QueryStringProps
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Logs.QueryStringProps |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awslogs#QueryStringProps |
Java | software.amazon.awscdk.services.logs.QueryStringProps |
Python | aws_cdk.aws_logs.QueryStringProps |
TypeScript (source) | aws-cdk-lib » aws_logs » QueryStringProps |
Properties for a QueryString.
Example
new logs.QueryDefinition(this, 'QueryDefinition', {
queryDefinitionName: 'MyQuery',
queryString: new logs.QueryString({
fields: ['@timestamp', '@message'],
parseStatements: [
'@message "[*] *" as loggingType, loggingMessage',
'@message "<*>: *" as differentLoggingType, differentLoggingMessage',
],
filterStatements: [
'loggingType = "ERROR"',
'loggingMessage = "A very strange error occurred!"',
],
sort: '@timestamp desc',
limit: 20,
}),
});
Properties
Name | Type | Description |
---|---|---|
display? | string | Specifies which fields to display in the query results. |
fields? | string[] | Retrieves the specified fields from log events for display. |
filter? | string | A single statement for filtering the results of a query based on a boolean expression. |
filter | string[] | An array of one or more statements for filtering the results of a query based on a boolean expression. |
limit? | number | Specifies the number of log events returned by the query. |
parse? | string | A single statement for parsing data from a log field and creating ephemeral fields that can be processed further in the query. |
parse | string[] | An array of one or more statements for parsing data from a log field and creating ephemeral fields that can be processed further in the query. |
sort? | string | Sorts the retrieved log events. |
stats? | string | Uses log field values to calculate aggregate statistics. |
display?
Type:
string
(optional, default: no display in QueryString)
Specifies which fields to display in the query results.
fields?
Type:
string[]
(optional, default: no fields in QueryString)
Retrieves the specified fields from log events for display.
filter?
⚠️ Deprecated: Use filterStatements
instead
Type:
string
(optional, default: no filter in QueryString)
A single statement for filtering the results of a query based on a boolean expression.
filterStatements?
Type:
string[]
(optional, default: no filter in QueryString)
An array of one or more statements for filtering the results of a query based on a boolean expression.
Each provided statement generates a separate filter line in the query string.
Note: If provided, this property overrides any value provided for the filter
property.
limit?
Type:
number
(optional, default: no limit in QueryString)
Specifies the number of log events returned by the query.
parse?
⚠️ Deprecated: Use parseStatements
instead
Type:
string
(optional, default: no parse in QueryString)
A single statement for parsing data from a log field and creating ephemeral fields that can be processed further in the query.
parseStatements?
Type:
string[]
(optional, default: no parse in QueryString)
An array of one or more statements for parsing data from a log field and creating ephemeral fields that can be processed further in the query.
Each provided statement generates a separate parse line in the query string.
Note: If provided, this property overrides any value provided for the parse
property.
sort?
Type:
string
(optional, default: no sort in QueryString)
Sorts the retrieved log events.
stats?
Type:
string
(optional, default: no stats in QueryString)
Uses log field values to calculate aggregate statistics.