class JsonPattern
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Logs.JsonPattern |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awslogs#JsonPattern |
Java | software.amazon.awscdk.services.logs.JsonPattern |
Python | aws_cdk.aws_logs.JsonPattern |
TypeScript (source) | aws-cdk-lib » aws_logs » JsonPattern |
Implements
IFilter
Obtainable from
Filter
.all()
, Filter
.any()
, Filter
.booleanValue()
, Filter
.exists()
, Filter
.isNull()
, Filter
.notExists()
, Filter
.numberValue()
, Filter
.stringValue()
Base class for patterns that only match JSON log events.
Example
// Search for all events where the component field is equal to
// "HttpServer" and either error is true or the latency is higher
// than 1000.
const pattern = logs.FilterPattern.all(
logs.FilterPattern.stringValue('$.component', '=', 'HttpServer'),
logs.FilterPattern.any(
logs.FilterPattern.booleanValue('$.error', true),
logs.FilterPattern.numberValue('$.latency', '>', 1000),
),
);
Initializer
new JsonPattern(jsonPatternString: string)
Parameters
- jsonPatternString
string
Properties
Name | Type | Description |
---|---|---|
json | string | |
log | string |
jsonPatternString
Type:
string
logPatternString
Type:
string