Ejemplo n.º 1
0
def logwatch_forward_pipe(
    path: Path,
    events: Sequence[SyslogMessage],
) -> LogwatchFordwardResult:
    if not events:
        return LogwatchFordwardResult()
    SyslogForwarderUnixSocket(path=path).forward(events)
    return LogwatchFordwardResult(num_forwarded=len(events))
Ejemplo n.º 2
0
def _forward_events_to_ec(
    raw_events: Iterable[DatadogAPIResponse],
    tag_regexes: Iterable[str],
    facility: int,
    severity: int,
    service_level: int,
    add_text: bool,
) -> None:
    SyslogForwarderUnixSocket().forward(
        _to_syslog_message(
            raw_event,
            tag_regexes,
            facility,
            severity,
            service_level,
            add_text,
        ) for raw_event in raw_events)