aws-cdk-lib.aws_logs.SpaceDelimitedTextPattern

class SpaceDelimitedTextPattern

LanguageType name
.NETAmazon.CDK.AWS.Logs.SpaceDelimitedTextPattern
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awslogs#SpaceDelimitedTextPattern
Javasoftware.amazon.awscdk.services.logs.SpaceDelimitedTextPattern
Pythonaws_cdk.aws_logs.SpaceDelimitedTextPattern
TypeScript (source)aws-cdk-lib » aws_logs » SpaceDelimitedTextPattern

Implements IFilterPattern

Space delimited text pattern.

Example

// Search for all events where the component is "HttpServer" and the
// result code is not equal to 200.
const pattern = logs.FilterPattern.spaceDelimited('time', 'component', '...', 'result_code', 'latency')
  .whereString('component', '=', 'HttpServer')
  .whereNumber('result_code', '!=', 200);

Initializer (protected)

super(columns: string[], restrictions: { [string]: ColumnRestriction[] })

Parameters

  • columns string[]
  • restrictions { [string]: ColumnRestriction[] }

Properties

NameTypeDescription
logPatternStringstring

logPatternString

Type: string

Methods

NameDescription
whereNumber(columnName, comparison, value)Restrict where the pattern applies.
whereString(columnName, comparison, value)Restrict where the pattern applies.
static construct(columns)Construct a new instance of a space delimited text pattern.

whereNumber(columnName, comparison, value)

public whereNumber(columnName: string, comparison: string, value: number): SpaceDelimitedTextPattern

Parameters

  • columnName string
  • comparison string
  • value number

Returns

  • SpaceDelimitedTextPattern

Restrict where the pattern applies.


whereString(columnName, comparison, value)

public whereString(columnName: string, comparison: string, value: string): SpaceDelimitedTextPattern

Parameters

  • columnName string
  • comparison string
  • value string

Returns

  • SpaceDelimitedTextPattern

Restrict where the pattern applies.


static construct(columns)

public static construct(columns: string[]): SpaceDelimitedTextPattern

Parameters

  • columns string[]

Returns

  • SpaceDelimitedTextPattern

Construct a new instance of a space delimited text pattern.

Since this class must be public, we can't rely on the user only creating it through the LogPattern.spaceDelimited() factory function. We must therefore validate the argument in the constructor. Since we're returning a copy on every mutation, and we don't want to re-validate the same things on every construction, we provide a limited set of mutator functions and only validate the new data every time.