Skip to content
v2.274.0

SpaceDelimitedTextPattern Class ​

Space delimited text pattern.

Example ​

ts
// Search for all events where the component is "HttpServer" and the
// result code is not equal to 200.
const pattern = logs.FilterPattern.spaceDelimited('time', 'component', '...', 'result_code', 'latency')
  .whereString('component', '=', 'HttpServer')
  .whereNumber('result_code', '!=', 200);

Properties ​

logPatternStringstringlog_pattern_stringstrlogPatternStringStringLogPatternStringstringLogPatternString*stringrequired#

Methods ​

construct(columns: string[]): SpaceDelimitedTextPattern // chainable@staticmethod def construct(columns: typing.List[str]) -> SpaceDelimitedTextPatternpublic static SpaceDelimitedTextPattern construct(List<String> columns)public static SpaceDelimitedTextPattern Construct(string[] columns)func Construct(Columns *[]*string) SpaceDelimitedTextPatternstatic#
Construct a new instance of a space delimited text pattern.
notes

Since this class must be public, we can't rely on the user only creating it through the LogPattern.spaceDelimited() factory function. We must therefore validate the argument in the constructor. Since we're returning a copy on every mutation, and we don't want to re-validate the same things on every construction, we provide a limited set of mutator functions and only validate the new data every time.

whereNumber(columnName: string, comparison: string, value: number): SpaceDelimitedTextPattern // chainabledef where_number(self, column_name: str, comparison: str, value: int | float) -> SpaceDelimitedTextPatternpublic SpaceDelimitedTextPattern whereNumber(String columnName, String comparison, Number value)public SpaceDelimitedTextPattern WhereNumber(string columnName, string comparison, double value)func WhereNumber(ColumnName *string, Comparison *string, Value *float64) SpaceDelimitedTextPattern#
Restrict where the pattern applies.
whereString(columnName: string, comparison: string, value: string): SpaceDelimitedTextPattern // chainabledef where_string(self, column_name: str, comparison: str, value: str) -> SpaceDelimitedTextPatternpublic SpaceDelimitedTextPattern whereString(String columnName, String comparison, String value)public SpaceDelimitedTextPattern WhereString(string columnName, string comparison, string value)func WhereString(ColumnName *string, Comparison *string, Value *string) SpaceDelimitedTextPattern#
Restrict where the pattern applies.