---
title: "lumberjack: Receive logs from Beats and Logstash"
url: "https://axoflow.com/docs/axosyslog-core/chapter-sources/lumberjack/"
description: "Receive events from Filebeat, other Beats, and Logstash over the Lumberjack protocol using the network() source."
last_modified: "2026-12-02T07:03:10+01:00"
---

> For the complete documentation index, see [llms.txt](https://axoflow.com/docs/axosyslog-core/llms.txt).

# lumberjack: Receive logs from Beats and Logstash

Receive events from Filebeat, other Beats, and Logstash over the Lumberjack protocol using the network() source.

Lumberjack is the protocol that [Filebeat](https://www.elastic.co/beats/filebeat)
, the other Beats, and Logstash use to send events to Logstash. The `lumberjack()` transport of the [`network()` source](https://axoflow.com/docs/axosyslog-core/chapter-sources/configuring-sources-network/index.md)
receives these events. Point the Logstash output of your Beats at AxoSyslog to process and route the events before you forward them to their final destination.

AxoSyslog accepts version 1 and version 2 of the protocol, and compressed frames.

## Prerequisites

- AxoSyslog version 4.30 or later. The `lumberjack()` transport is part of the core package.

## Example: Receiving events from Filebeat

The following source listens for Lumberjack connections on port 5044, the default port of the Beats protocol, over TLS:

```shell
source s_beats {
  network(
    port(5044)
    transport(lumberjack(max-window-size(2048)))
    tls(
      key-file("/etc/syslog-ng/beats.key")
      cert-file("/etc/syslog-ng/beats.crt")
    )
  );
};

log {
  source(s_beats);
  destination(d_buffered);
  flags(flow-control);
};
```

Configure the Logstash output of your Filebeat to point at this address, for example:

```yaml
output.logstash:
  hosts: ["<IP-of-AxoSyslog>:5044"]
  ssl.enabled: true
  ssl.certificate_authorities: ["/etc/filebeat/ca.crt"]
  bulk_max_size: 2048
```

To receive the events without TLS, omit the `tls()` option from the source, and the `ssl.*` options from the Filebeat configuration.

## How lumberjack() processes the events

- Every event becomes a separate log message.
- AxoSyslog doesn’t parse the event as a syslog message. The `${MESSAGE}` macro contains the event as JSON, exactly as the sender sent it.
- Version 1 of the protocol sends the events as key-value pairs. AxoSyslog converts them into a JSON object.
- The `${.lumberjack.version}` name-value pair contains the version of the protocol that the event arrived in (`1` or `2`).
- The `${HOST}` macro contains the address or the hostname of the sender, depending on the [`use-dns()`](https://axoflow.com/docs/axosyslog-core/chapter-sources/configuring-sources-network/reference-source-network/index.md#use-dns)
  option.
- The timestamps of the message are the time when AxoSyslog received it.

To access the fields of the event, parse `${MESSAGE}` with the [`json-parser()`](https://axoflow.com/docs/axosyslog-core/chapter-parsers/json-parser/index.md)
or in [FilterX](https://axoflow.com/docs/axosyslog-core/filterx/index.md)
. The following example uses the [`=??` operator](https://axoflow.com/docs/axosyslog-core/filterx/operator-reference/index.md#assign-non-null)
, so `${HOST}` and `${MESSAGE}` keep their original values if the event doesn’t have the `host.name` or `message` field:

```shell
log {
  source(s_beats);
  filterx {
    event = json($MESSAGE);
    $HOST =?? event.host.name;
    $MESSAGE =?? event.message;
  };
  destination(d_buffered);
  flags(flow-control);
};
```

### Acknowledgements and flow control

The sender sends the events in windows. It considers the events of a window delivered only when AxoSyslog acknowledges the window. AxoSyslog acknowledges a window when it has processed the last event of the window:

- With [flow control](https://axoflow.com/docs/axosyslog-core/chapter-routing-filters/concepts-flow-control/index.md)
  (`flags(flow-control)`) and a [disk-buffer](https://axoflow.com/docs/axosyslog-core/chapter-routing-filters/concepts-diskbuffer/index.md)
  in the destination, the acknowledgement means that the events are stored. If AxoSyslog stops before it stores the events, the sender resends them.
- Without flow control, the acknowledgement means only that AxoSyslog has received the events. Logstash works the same way.

While a window waits for its acknowledgement, AxoSyslog sends keepalive messages to the sender (see [`keepalive-interval()`](https://axoflow.com/docs/axosyslog-core/chapter-sources/lumberjack/index.md#keepalive-interval)
), so that the sender doesn’t time out.

## Options of the lumberjack() transport

You can use the following options in the `lumberjack()` transport, for example, `transport(lumberjack(max-window-size(2048) window-timeout(60)))`. Without options, you can also use the `transport(lumberjack)` form.

In addition, the following [options of the `network()` source](https://axoflow.com/docs/axosyslog-core/chapter-sources/configuring-sources-network/reference-source-network/index.md)
apply:

- `port()`: The default port of the `lumberjack()` transport is 5044.
- `tls()`: AxoSyslog starts the TLS handshake with the first byte of the connection, as the protocol requires.
- `log-msg-size()`: The maximal size of a single event. AxoSyslog drops larger events, logs a warning, and increases the `syslogng_lumberjack_frames_dropped_total` counter.
- `idle-timeout()`: How long AxoSyslog waits for the next window of the sender.

### keepalive-interval()

|  |  |
| --- | --- |
| Type: | number (seconds) |
| Default: | `5` |

*Description:* How often AxoSyslog sends a keepalive message to the sender while a window waits for its acknowledgement, for example, because of flow control. Set it to `0` to disable keepalives.

### max-inflated-size()

|  |  |
| --- | --- |
| Type: | number (bytes) |
| Default: | `67108864` (64 MiB) |

*Description:* The maximal size of a compressed frame after decompression. AxoSyslog closes the connection if a compressed frame inflates to a larger size. This protects AxoSyslog from compression bombs. Set it to `0` to disable the limit.

### max-window-size()

|  |  |
| --- | --- |
| Type: | number |
| Default: | `10000` |

*Description:* The largest window that AxoSyslog accepts. A window is the number of events that the sender sends before it waits for an acknowledgement. If the sender announces a larger window, AxoSyslog closes the connection. Set it to `0` to accept windows of any size.

**CAUTION:**

Set this option to at least the batch size of the sender, for example, the `bulk_max_size` option of Filebeat. The sender cannot learn the limit of AxoSyslog. If its windows are larger, it reconnects and resends the same window indefinitely. In this case, AxoSyslog logs an error message that includes the window size of the sender.

### window-timeout()

|  |  |
| --- | --- |
| Type: | number (seconds) |
| Default: | `30` |

*Description:* How long a window can stall before all of its events arrive. If the sender stops sending in the middle of a window for longer than this, AxoSyslog closes the connection. Set it to `0` to disable the timeout.

## Metrics of the lumberjack() transport

The `lumberjack()` transport has the following metrics, available at `stats(level(1))` and above:

`syslogng_lumberjack_frames_total`
:   The number of events received, by protocol version (`version` label: `1` or `2`).

`syslogng_lumberjack_acknowledgements_total`
:   The number of acknowledgements sent to the senders.

`syslogng_lumberjack_frames_dropped_total`
:   The number of events dropped because they were larger than `log-msg-size()` (`reason="too_large"`).

`syslogng_lumberjack_protocol_errors_total`
:   The number of connections closed because of a protocol error. The `reason` label shows the type of the error:

    - `version`: unknown protocol version
    - `frame_type`: unknown or unexpected frame type
    - `window_size`: the window is larger than `max-window-size()`
    - `length`: invalid frame length
    - `compression`: invalid compressed data
    - `inflated_size`: the decompressed frame is larger than `max-inflated-size()`

Last modified December 2, 2026: [Remove peer-verify from the example (02893dc3)](https://github.com/axoflow/axosyslog-core-docs/commit/02893dc39525c9544d5d99f4f15151c3f579a49c)
