JsonPattern

class aws_cdk.aws_logs.JsonPattern(json_pattern_string)

Bases: object

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.
pattern = logs.FilterPattern.all(
    logs.FilterPattern.string_value("$.component", "=", "HttpServer"),
    logs.FilterPattern.any(
        logs.FilterPattern.boolean_value("$.error", True),
        logs.FilterPattern.number_value("$.latency", ">", 1000)))
Parameters

json_pattern_string (str) –

Attributes

json_pattern_string
Return type

str

log_pattern_string
Return type

str