lscl.filters
– Logstash filter related utilities¶
- lscl.filters.LogstashFilters = LogstashFilters¶
Type representing a list of Logstash filters and branching.
- pydantic model lscl.filters.LogstashFilterBranching¶
Bases:
BaseModel
Condition under which one or more filters can be executed.
- field conditions: Annotated[list[tuple[LsclCondition, LogstashFilters]], Len(min_length=1)] [Required]¶
Conditions and associated filters and additional branching.
- lscl.filters.parse_logstash_filters(raw: str | LsclContent | LsclBlock, /, *, at_root: bool | None = None) LogstashFilters ¶
Decode filters from a Logstash configuration file.
- Parameters:
- Returns:
Obtained Logstash filters.
- Return type:
LogstashFilters
- lscl.filters.render_logstash_filters(filters: LogstashFilters, /, *, escapes_supported: bool = False, field_reference_escape_style: Literal['percent', 'ampersand', 'none'] = 'none') str ¶
Render Logstash filters.
- Parameters:
filters (LogstashFilters) – Logstash filters or branching.
escapes_supported (bool) – Whether
config.support_escapes
is defined as true in the configuration of the target environment.field_reference_escape_style (Literal['percent', 'ampersand', 'none']) – The
config.field_reference.escape_style
value in the configuration of the target environment.
- Returns:
Filters encoded using LSCL.
- Raises:
StringRenderingError – A string could not be rendered due to invalid characters being present.
SelectorElementRenderingError – A selector could not be rendered due to invalid characters being in one of its elements.
- Return type: