aws-cdk-lib.aws_logs.QueryStringProps

interface QueryStringProps

LanguageType name
.NETAmazon.CDK.AWS.Logs.QueryStringProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awslogs#QueryStringProps
Javasoftware.amazon.awscdk.services.logs.QueryStringProps
Pythonaws_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

NameTypeDescription
display?stringSpecifies which fields to display in the query results.
fields?string[]Retrieves the specified fields from log events for display.
filter?⚠️stringA single statement for filtering the results of a query based on a boolean expression.
filterStatements?string[]An array of one or more statements for filtering the results of a query based on a boolean expression.
limit?numberSpecifies the number of log events returned by the query.
parse?⚠️stringA single statement for parsing data from a log field and creating ephemeral fields that can be processed further in the query.
parseStatements?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?stringSorts the retrieved log events.
stats?stringUses 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.