Class FilterPattern
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
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. JsonPattern pattern = FilterPattern.all(FilterPattern.stringValue("$.component", "=", "HttpServer"), FilterPattern.any(FilterPattern.booleanValue("$.error", true), FilterPattern.numberValue("$.latency", ">", 1000)));
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
-
Constructor Summary
ModifierConstructorDescriptionprotected
FilterPattern
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
FilterPattern
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionstatic JsonPattern
all
(@NotNull JsonPattern... patterns) A JSON log pattern that matches if all given JSON log patterns match.static IFilterPattern
A log pattern that matches all events.static IFilterPattern
A log pattern that matches if all the strings given appear in the event.static JsonPattern
any
(@NotNull JsonPattern... patterns) A JSON log pattern that matches if any of the given JSON log patterns match.static IFilterPattern
A log pattern that matches if any of the strings given appear in the event.static IFilterPattern
anyTermGroup
(@NotNull 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
A JSON log patter that matches if the field exists.static JsonPattern
A JSON log pattern that matches if the field exists and has the special value 'null'.static IFilterPattern
Use the given string as log pattern.static JsonPattern
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
(@NotNull 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.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
FilterPattern
protected FilterPattern(software.amazon.jsii.JsiiObjectRef objRef) -
FilterPattern
protected FilterPattern(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
FilterPattern
@Stability(Stable) public FilterPattern()
-
-
Method Details
-
all
@Stability(Stable) @NotNull public static JsonPattern all(@NotNull @NotNull JsonPattern... patterns) A JSON log pattern that matches if all given JSON log patterns match.- Parameters:
patterns
- This parameter is required.
-
allEvents
A log pattern that matches all events. -
allTerms
@Stability(Stable) @NotNull public static IFilterPattern allTerms(@NotNull @NotNull String... terms) A log pattern that matches if all the strings given appear in the event.- Parameters:
terms
- The words to search for. This parameter is required.
-
any
@Stability(Stable) @NotNull public static JsonPattern any(@NotNull @NotNull JsonPattern... patterns) A JSON log pattern that matches if any of the given JSON log patterns match.- Parameters:
patterns
- This parameter is required.
-
anyTerm
A log pattern that matches if any of the strings given appear in the event.- Parameters:
terms
- The words to search for. This parameter is required.
-
anyTermGroup
@Stability(Stable) @NotNull public static IFilterPattern anyTermGroup(@NotNull @NotNull List<String>... termGroups) A log pattern that matches if any of the given term groups matches the event.A term group matches an event if all the terms in it appear in the event string.
- Parameters:
termGroups
- A list of term groups to search for. This parameter is required.
-
booleanValue
@Stability(Stable) @NotNull public static JsonPattern booleanValue(@NotNull String jsonField, @NotNull Boolean value) A JSON log pattern that matches if the field exists and equals the boolean value.- Parameters:
jsonField
- Field inside JSON. This parameter is required.value
- The value to match. This parameter is required.
-
exists
A JSON log patter that matches if the field exists.This is a readable convenience wrapper over 'field = *'
- Parameters:
jsonField
- Field inside JSON. This parameter is required.
-
isNull
A JSON log pattern that matches if the field exists and has the special value 'null'.- Parameters:
jsonField
- Field inside JSON. This parameter is required.
-
literal
Use the given string as log pattern.See https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html for information on writing log patterns.
- Parameters:
logPatternString
- The pattern string to use. This parameter is required.
-
notExists
A JSON log pattern that matches if the field does not exist.- Parameters:
jsonField
- Field inside JSON. This parameter is required.
-
numberValue
@Stability(Stable) @NotNull public static JsonPattern numberValue(@NotNull String jsonField, @NotNull String comparison, @NotNull Number value) A JSON log pattern that compares numerical values.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
- Parameters:
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.
-
spaceDelimited
@Stability(Stable) @NotNull public static SpaceDelimitedTextPattern spaceDelimited(@NotNull @NotNull String... columns) A space delimited log pattern matcher.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.
- Parameters:
columns
- The columns in the space-delimited log stream. This parameter is required.
-
stringValue
@Stability(Stable) @NotNull public static JsonPattern stringValue(@NotNull String jsonField, @NotNull String comparison, @NotNull String value) A JSON log pattern that compares string values.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
- Parameters:
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.
-