@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:40.704Z") @Stability(value=Stable) public class FilterPattern extends software.amazon.jsii.JsiiObject
Example:
// Search for lines that contain both "ERROR" and "MainThread"
IFilterPattern pattern1 = FilterPattern.allTerms("ERROR", "MainThread");
// Search for lines that either contain both "ERROR" and "MainThread", or
// both "WARN" and "Deadlock".
IFilterPattern pattern2 = FilterPattern.anyTermGroup(List.of("ERROR", "MainThread"), List.of("WARN", "Deadlock"));
| Modifier | Constructor and Description |
|---|---|
|
FilterPattern() |
protected |
FilterPattern(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
FilterPattern(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
static JsonPattern |
all(JsonPattern... patterns)
A JSON log pattern that matches if all given JSON log patterns match.
|
static IFilterPattern |
allEvents()
A log pattern that matches all events.
|
static IFilterPattern |
allTerms(String... terms)
A log pattern that matches if all the strings given appear in the event.
|
static JsonPattern |
any(JsonPattern... patterns)
A JSON log pattern that matches if any of the given JSON log patterns match.
|
static IFilterPattern |
anyTerm(String... terms)
A log pattern that matches if any of the strings given appear in the event.
|
static IFilterPattern |
anyTermGroup(List<String>... termGroups)
A log pattern that matches if any of the given term groups matches the event.
|
static JsonPattern |
booleanValue(String jsonField,
Boolean value)
A JSON log pattern that matches if the field exists and equals the boolean value.
|
static JsonPattern |
exists(String jsonField)
A JSON log patter that matches if the field exists.
|
static JsonPattern |
isNull(String jsonField)
A JSON log pattern that matches if the field exists and has the special value 'null'.
|
static IFilterPattern |
literal(String logPatternString)
Use the given string as log pattern.
|
static JsonPattern |
notExists(String jsonField)
A JSON log pattern that matches if the field does not exist.
|
static JsonPattern |
numberValue(String jsonField,
String comparison,
Number value)
A JSON log pattern that compares numerical values.
|
static SpaceDelimitedTextPattern |
spaceDelimited(String... columns)
A space delimited log pattern matcher.
|
static JsonPattern |
stringValue(String jsonField,
String comparison,
String value)
A JSON log pattern that compares string values.
|
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected FilterPattern(software.amazon.jsii.JsiiObjectRef objRef)
protected FilterPattern(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable) public FilterPattern()
@Stability(value=Stable) @NotNull public static JsonPattern all(@NotNull JsonPattern... patterns)
patterns - This parameter is required.@Stability(value=Stable) @NotNull public static IFilterPattern allEvents()
@Stability(value=Stable) @NotNull public static IFilterPattern allTerms(@NotNull String... terms)
terms - The words to search for. This parameter is required.@Stability(value=Stable) @NotNull public static JsonPattern any(@NotNull JsonPattern... patterns)
patterns - This parameter is required.@Stability(value=Stable) @NotNull public static IFilterPattern anyTerm(@NotNull String... terms)
terms - The words to search for. This parameter is required.@Stability(value=Stable) @NotNull public static IFilterPattern anyTermGroup(@NotNull List<String>... termGroups)
A term group matches an event if all the terms in it appear in the event string.
termGroups - A list of term groups to search for. This parameter is required.@Stability(value=Stable) @NotNull public static JsonPattern booleanValue(@NotNull String jsonField, @NotNull Boolean value)
jsonField - Field inside JSON. This parameter is required.value - The value to match. This parameter is required.@Stability(value=Stable) @NotNull public static JsonPattern exists(@NotNull String jsonField)
This is a readable convenience wrapper over 'field = *'
jsonField - Field inside JSON. This parameter is required.@Stability(value=Stable) @NotNull public static JsonPattern isNull(@NotNull String jsonField)
jsonField - Field inside JSON. This parameter is required.@Stability(value=Stable) @NotNull public static IFilterPattern literal(@NotNull String logPatternString)
See https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html for information on writing log patterns.
logPatternString - The pattern string to use. This parameter is required.@Stability(value=Stable) @NotNull public static JsonPattern notExists(@NotNull String jsonField)
jsonField - Field inside JSON. This parameter is required.@Stability(value=Stable) @NotNull public static JsonPattern numberValue(@NotNull String jsonField, @NotNull String comparison, @NotNull Number value)
This pattern only matches if the event is a JSON event, and the indicated field inside compares with the value in the indicated way.
Use '$' to indicate the root of the JSON structure. The comparison operator can only compare equality or inequality. The '*' wildcard may appear in the value may at the start or at the end.
For more information, see:
https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html
jsonField - Field inside JSON. This parameter is required.comparison - Comparison to carry out. This parameter is required.value - The numerical value to compare to. This parameter is required.@Stability(value=Stable) @NotNull public static SpaceDelimitedTextPattern spaceDelimited(@NotNull String... columns)
The log event is divided into space-delimited columns (optionally enclosed by "" or [] to capture spaces into column values), and names are given to each column.
'...' may be specified once to match any number of columns.
Afterwards, conditions may be added to individual columns.
columns - The columns in the space-delimited log stream. This parameter is required.@Stability(value=Stable) @NotNull public static JsonPattern stringValue(@NotNull String jsonField, @NotNull String comparison, @NotNull String value)
This pattern only matches if the event is a JSON event, and the indicated field inside compares with the string value.
Use '$' to indicate the root of the JSON structure. The comparison operator can only compare equality or inequality. The '*' wildcard may appear in the value may at the start or at the end.
For more information, see:
https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html
jsonField - Field inside JSON. This parameter is required.comparison - Comparison to carry out. This parameter is required.value - The string value to compare to. This parameter is required.Copyright © 2022. All rights reserved.