Skip to main content

Module

Declarative filter builders for SDK queries.

Filter

Base class for declarative filter construction. This class defines the interface for building type-safe filters that can be used with LogStream queries and other SDK operations.

TextFilter

Builder for text-based filters. Supports operators: equals, not_equals, contains, one_of, not_in Examples

contains

Filter for text that contains a substring. Arguments
  • value: The substring to search for.

equals

Filter for exact text match. Arguments
  • value: The text value to match.

not_equals

Filter for text that does not match. Arguments
  • value: The text value to exclude.

not_in

Filter for text that does not match any value in a list. Arguments
  • values: List of text values to exclude.

one_of

Filter for text that matches any value in a list. Arguments
  • values: List of text values to match.

NumberFilter

Builder for number-based filters. Supports operators: equals, not_equals, greater_than, greater_than_or_equal, less_than, less_than_or_equal, between Examples

between

Filter for numbers within a range (inclusive). Arguments
  • min_value: The minimum value (inclusive).
  • max_value: The maximum value (inclusive).

equals

Filter for exact number match. Arguments
  • value: The number to match.

greater_than

Filter for numbers greater than a value. Arguments
  • value: The threshold value (exclusive).

greater_than_or_equal

Filter for numbers greater than or equal to a value. Arguments
  • value: The threshold value (inclusive).

less_than

Filter for numbers less than a value. Arguments
  • value: The threshold value (exclusive).

less_than_or_equal

Filter for numbers less than or equal to a value. Arguments
  • value: The threshold value (inclusive).

not_equals

Filter for numbers that don’t match. Arguments
  • value: The number to exclude.

DateFilter

Builder for date-based filters. Supports operators: equals, not_equals, before, after, on_or_before, on_or_after Examples

after

Filter for dates after a value (exclusive). Arguments
  • value: The threshold date (string or datetime).

before

Filter for dates before a value (exclusive). Arguments
  • value: The threshold date (string or datetime).

equals

Filter for exact date match. Arguments
  • value: The date to match (string or datetime).

not_equals

Filter for dates that don’t match. Arguments
  • value: The date to exclude (string or datetime).

on_or_after

Filter for dates on or after a value (inclusive). Arguments
  • value: The threshold date (string or datetime).

on_or_before

Filter for dates on or before a value (inclusive). Arguments
  • value: The threshold date (string or datetime).

BooleanFilter

Builder for boolean-based filters. Boolean filters are simple equality checks - there are no operators, just matching against true or false values. Examples

equals

Filter for exact boolean match. Arguments
  • value: The boolean value to match (True or False).

is_false

Filter for boolean columns that are False.

Returns

LogRecordsBooleanFilter: A configured boolean filter for False.

is_true

Filter for boolean columns that are True.

Returns

LogRecordsBooleanFilter: A configured boolean filter for True.

boolean

Create a boolean filter builder. Arguments
  • column_id: The ID of the column to filter on.

date

Create a date filter builder. Arguments
  • column_id: The ID of the column to filter on.

number

Create a number filter builder. Arguments
  • column_id: The ID of the column to filter on.

text

Create a text filter builder. Arguments
  • column_id: The ID of the column to filter on.
  • case_sensitive: Whether the filter should be case-sensitive. Default is True.