Typing Annotations

Zeek Data Types

Simple Types

zlogging.typing.zeek_addr

Zeek addr data type.

alias of TypeVar(‘zeek_addr’)

zlogging.typing.zeek_bool

Zeek bool data type.

alias of TypeVar(‘zeek_bool’)

zlogging.typing.zeek_count

Zeek count data type.

alias of TypeVar(‘zeek_count’)

zlogging.typing.zeek_double

Zeek double data type.

alias of TypeVar(‘zeek_double’)

zlogging.typing.zeek_enum

Zeek enum data type.

alias of TypeVar(‘zeek_enum’)

zlogging.typing.zeek_interval

Zeek interval data type.

alias of TypeVar(‘zeek_interval’)

zlogging.typing.zeek_int

Zeek int data type.

alias of TypeVar(‘zeek_int’)

zlogging.typing.zeek_port

Zeek port data type.

alias of TypeVar(‘zeek_port’)

zlogging.typing.zeek_string

Zeek string data type.

alias of TypeVar(‘zeek_string’)

zlogging.typing.zeek_subnet

Zeek subnet data type.

alias of TypeVar(‘zeek_subnet’)

zlogging.typing.zeek_time

Zeek time data type.

alias of TypeVar(‘zeek_time’)

Generic Types

class zlogging.typing.zeek_set(empty_field=None, unset_field=None, set_separator=None, element_type=None, *args, **kwargs)[source]

Zeek set data type.

Notes

As a generic data type, the class supports the typing proxy as introduced PEP 484:

class MyLog(zeek_record):
    field_one: zeek_set[zeek_str]

which is the same at runtime as following:

class MyLog(zeek_record):
    field_one = SetType(element_type=StringType())
class zlogging.typing.zeek_vector(empty_field=None, unset_field=None, set_separator=None, element_type=None, *args, **kwargs)[source]

Zeek vector data type.

Notes

As a generic data type, the class supports the typing proxy as introduced PEP 484:

class MyLog(zeek_record):
    field_one: zeek_vector[zeek_str]

which is the same at runtime as following:

class MyLog(zeek_record):
    field_one = VectorType(element_type=StringType())

Variadic Types

class zlogging.typing.zeek_record(empty_field=None, unset_field=None, set_separator=None, *args, **element_mapping)[source]

Zeek record data type.

Notes

As a variadic data type, it supports the typing proxy as TypedDict, introduced in PEP 589:

class MyLog(zeek_record):
    field_one: zeek_int
    field_two: zeek_set[zeek_port]

which is the same at runtime as following:

RecordType(field_one=IntType,
           field_two=SetType(element_type=PortType))

See also

See expand_typing() for more information about the processing of typing proxy.

Bro Data Types

Warning

Use of bro is deprecated. Please use zeek instead.

Simple Types

zlogging.typing.bro_addr

Bro addr data type.

alias of TypeVar(‘bro_addr’)

zlogging.typing.bro_bool

Bro bool data type.

alias of TypeVar(‘bro_bool’)

zlogging.typing.bro_count

Bro count data type.

alias of TypeVar(‘bro_count’)

zlogging.typing.bro_double

Bro double data type.

alias of TypeVar(‘bro_double’)

zlogging.typing.bro_enum

Bro enum data type.

alias of TypeVar(‘bro_enum’)

zlogging.typing.bro_interval

Bro interval data type.

alias of TypeVar(‘bro_interval’)

zlogging.typing.bro_int

Bro int data type.

alias of TypeVar(‘bro_int’)

zlogging.typing.bro_port

Bro port data type.

alias of TypeVar(‘bro_port’)

zlogging.typing.bro_string

Bro string data type.

alias of TypeVar(‘bro_string’)

zlogging.typing.bro_subnet

Bro subnet data type.

alias of TypeVar(‘bro_subnet’)

zlogging.typing.bro_time

Bro time data type.

alias of TypeVar(‘bro_time’)

Generic Types

zlogging.typing.bro_set[source]

alias of zlogging.typing._deprecated.<locals>.DeprecatedType

zlogging.typing.bro_vector[source]

alias of zlogging.typing._deprecated.<locals>.DeprecatedType

Variadic Types

zlogging.typing.bro_record[source]

alias of zlogging.typing._deprecated.<locals>.DeprecatedType