Class FilterPattern
A collection of static methods to generate appropriate ILogPatterns.
Inheritance
Namespace: Amazon.CDK.AWS.Logs
Assembly: Amazon.CDK.AWS.Logs.dll
Syntax (csharp)
public class FilterPattern : DeputyBase
Syntax (vb)
Public Class FilterPattern
Inherits DeputyBase
Remarks
stability: Stable
Synopsis
Constructors
FilterPattern() | |
FilterPattern(ByRefValue) | |
FilterPattern(DeputyBase.DeputyProps) |
Methods
All(JsonPattern[]) | A JSON log pattern that matches if all given JSON log patterns match. |
AllEvents() | A log pattern that matches all events. |
AllTerms(String[]) | A log pattern that matches if all the strings given appear in the event. |
Any(JsonPattern[]) | A JSON log pattern that matches if any of the given JSON log patterns match. |
AnyTerm(String[]) | A log pattern that matches if any of the strings given appear in the event. |
AnyTermGroup(String[][]) | A log pattern that matches if any of the given term groups matches the event. |
BooleanValue(String, Boolean) | A JSON log pattern that matches if the field exists and equals the boolean value. |
Exists(String) | A JSON log patter that matches if the field exists. |
IsNull(String) | A JSON log pattern that matches if the field exists and has the special value 'null'. |
Literal(String) | Use the given string as log pattern. |
NotExists(String) | A JSON log pattern that matches if the field does not exist. |
NumberValue(String, String, Double) | A JSON log pattern that compares numerical values. |
SpaceDelimited(String[]) | A space delimited log pattern matcher. |
StringValue(String, String, String) | A JSON log pattern that compares string values. |
Constructors
FilterPattern()
public FilterPattern()
FilterPattern(ByRefValue)
protected FilterPattern(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
FilterPattern(DeputyBase.DeputyProps)
protected FilterPattern(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
Methods
All(JsonPattern[])
A JSON log pattern that matches if all given JSON log patterns match.
public static JsonPattern All(params JsonPattern[] patterns)
Parameters
- patterns JsonPattern[]
Returns
Remarks
stability: Stable
AllEvents()
A log pattern that matches all events.
public static IFilterPattern AllEvents()
Returns
Remarks
stability: Stable
AllTerms(String[])
A log pattern that matches if all the strings given appear in the event.
public static IFilterPattern AllTerms(params string[] terms)
Parameters
- terms System.String[]
The words to search for.
Returns
Remarks
stability: Stable
Any(JsonPattern[])
A JSON log pattern that matches if any of the given JSON log patterns match.
public static JsonPattern Any(params JsonPattern[] patterns)
Parameters
- patterns JsonPattern[]
Returns
Remarks
stability: Stable
AnyTerm(String[])
A log pattern that matches if any of the strings given appear in the event.
public static IFilterPattern AnyTerm(params string[] terms)
Parameters
- terms System.String[]
The words to search for.
Returns
Remarks
stability: Stable
AnyTermGroup(String[][])
A log pattern that matches if any of the given term groups matches the event.
public static IFilterPattern AnyTermGroup(params string[][] termGroups)
Parameters
- termGroups System.String[][]
A list of term groups to search for.
Returns
Remarks
A term group matches an event if all the terms in it appear in the event string. stability: Stable
BooleanValue(String, Boolean)
A JSON log pattern that matches if the field exists and equals the boolean value.
public static JsonPattern BooleanValue(string jsonField, bool value)
Parameters
- jsonField System.String
Field inside JSON.
- value System.Boolean
Field inside JSON.
Returns
Remarks
stability: Stable
Exists(String)
A JSON log patter that matches if the field exists.
public static JsonPattern Exists(string jsonField)
Parameters
- jsonField System.String
Field inside JSON.
Returns
Remarks
This is a readable convenience wrapper over 'field = *' stability: Stable
IsNull(String)
A JSON log pattern that matches if the field exists and has the special value 'null'.
public static JsonPattern IsNull(string jsonField)
Parameters
- jsonField System.String
Field inside JSON.
Returns
Remarks
stability: Stable
Literal(String)
Use the given string as log pattern.
public static IFilterPattern Literal(string logPatternString)
Parameters
- logPatternString System.String
The pattern string to use.
Returns
Remarks
See https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html for information on writing log patterns. stability: Stable
NotExists(String)
A JSON log pattern that matches if the field does not exist.
public static JsonPattern NotExists(string jsonField)
Parameters
- jsonField System.String
Field inside JSON.
Returns
Remarks
stability: Stable
NumberValue(String, String, Double)
A JSON log pattern that compares numerical values.
public static JsonPattern NumberValue(string jsonField, string comparison, double value)
Parameters
- jsonField System.String
Field inside JSON.
- comparison System.String
Comparison to carry out.
- value System.Double
Field inside JSON.
Returns
Remarks
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 stability: Stable
SpaceDelimited(String[])
A space delimited log pattern matcher.
public static SpaceDelimitedTextPattern SpaceDelimited(params string[] columns)
Parameters
- columns System.String[]
The columns in the space-delimited log stream.
Returns
Remarks
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. stability: Stable
StringValue(String, String, String)
A JSON log pattern that compares string values.
public static JsonPattern StringValue(string jsonField, string comparison, string value)
Parameters
- jsonField System.String
Field inside JSON.
- comparison System.String
Comparison to carry out.
- value System.String
Field inside JSON.
Returns
Remarks
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 stability: Stable