Beats (Lumberjack)

Receive data from Filebeat, Winlogbeat, other Elastic Beats, and Logstash over the Lumberjack protocol.

Beats (Lumberjack) connectors of AxoRouter receive log events from Filebeat, Winlogbeat, the other Elastic Beats, and Logstash. These clients use the Lumberjack protocol, which is the protocol of the Logstash output of Beats. Point the Logstash output of your Beats at AxoRouter instead of your Logstash server, and Axoflow ingests the events they send.

Prerequisites

To receive data over TLS, you’ll need a key and a certificate that the connector shows to the clients.

If you want to enable TLS encryption for this connector to encrypt the communication with the sources, you’ll need to set appropriate keys and certificates.

CAUTION:

Copy the keys and certificates to AxoRouter before starting to configure the connector. Otherwise, you won’t be able to make configuration changes that require reloading the AxoRouter service, including starting log tapping or flow tapping.

Note the following points:

  • Keys and certificates must be in PEM format.
  • If the file contains a certificate chain, the file must begin with the certificate of the host, followed by the CA certificate that signed the certificate of the host, and any other signing CAs in order.
  • If you manually copy these files to their place on the AxoRouter host, make the files readable by the axorouter service.
    • The recommended path for certificates is under /etc/axorouter/user-config/ (for example, /etc/axorouter/user-config/tls-key.pem). (If you need to use a different path, you have to append an option like -v /your/path:/your/path to the AXOROUTER_PODMAN_ARGS variable of /etc/axorouter/container.env.)
    • When referring to the key or certificate when configuring the connector, use absolute paths (for example, /etc/axorouter/user-config/tls-key.pem).

Add a Beats (Lumberjack) connector

To add a new connector to an AxoRouter host, complete the following steps:

  1. Select Pipeline > Routers > Connector Rules > Add Connector Rule. (Alternatively, you can select Add Connector > Add a connector rule on the Connectors page of an AxoRouter host.)

    Connector rules list

  2. Select Beats (Lumberjack).

  3. Configure the connector rule.

    1. Enter a name for the connector rule into the Connector rule name field.

      Generic connector rule parameters

    2. (Optional) Add labels to the connector rule. You will be able to use these labels in Flow Processing steps , for example, in the Query field of Select Messages steps. For details about the message schema and the related connector-specific fields, see the meta.connector object .

    3. Set the Router selector for the connector rule. The selector determines which AxoRouter instances will have a connector based on this connector rule.

      Router selectors

      You can use any labels and metadata of the AxoRouter hosts in the Router selectors, for example, the hostname of the AxoRouter, or any custom labels .

      • If you leave the router selector empty, it matches every AxoRouter instance.
      • To select only a specific AxoRouter instance, set the name field to the name of the instance as selector. For example, name = my-axorouter.
      • If you set multiple fields in the selector, the selector will match only AxoRouter instances that match all elements of the selector. (There in an AND relationship between the fields.)
    4. (Optional) Enter a Suffix for the connector rule. AxoConsole uses the suffix in the name of the connector instances that it creates on the AxoRouter hosts. The name of the connector instance follows the <name-of-AxoRouter>-<suffix> schema. For example, if the name of a matching AxoRouter instance is axorouter-1, and the suffix of the rule is custom, the name of the connector on that AxoRouter is axorouter-1-custom.

      If the Suffix field is empty, AxoConsole uses the name of the connector rule instead. For example, if the name of the connector rule is otlp-1, the name of the connector is axorouter-1-otlp-1.

    5. (Optional) Enter a description for the rule.

    6. If needed, turn on the Classify and Parse steps in the Preprocessing steps section (they’re off by default), so AxoRouter automatically identifies and parses messages sent by supported data sources . If your source is not listed, contact us .

      Enabling these options processes all data received by the connectors created based on this connector rule. If you want to apply classification and parsing more selectively, you can use the Classify and Parse processing steps in your Flows .

      Note that the Parse processing step requires Classify to be enabled. Parsing automatically parses the data from the content of the message, and replaces the message content (the log.body field in the internal message schema) with the structured information.

    7. (Optional) If needed, you can add other preprocessing steps to the connector rule. You can use the same processing steps as in flows . These can be useful if you use a dedicated connector rule to fix or annotate data coming from some specific sources. To reuse the preprocessing steps in other connector rules or flows, select Save as Custom Step.

  4. (Optional) Set the Port number where the connector receives the events. If you leave it empty, the connector listens on port 5044, the default port of the Logstash output of Beats.

    CAUTION:

    TCP and UDP port range 29500–29519 is reserved for AxoRouter’s internal listeners and cannot be used in connector rules.

  5. (Optional) To receive data over TLS, select Enable TLS, then set the certificate and the private key that AxoRouter shows to the clients. The Lumberjack protocol has no STARTTLS: if you enable TLS, every client must connect over TLS. The connector doesn’t request client certificates.

    • Server certificate: The certificate that AxoRouter shows to the clients.

      • To provide the server certificate from the AxoConsole, select Paste value and paste the server certificate. AxoConsole will automatically deploy the server certificate to the related AxoRouters.
      • To provide the server certificate from a file, select File path and enter the path where the certificate file is located (for example, /etc/axorouter/user-config/server-certificate.pem). The path must be mounted into the container, /etc/axorouter is mounted by default. You must manually copy that file to its place on every affected AxoRouter, or you can use the configuration management system of your choice.
    • Server private key: The private key of the server certificate.

      • To provide the server private key from the AxoConsole, select Paste value and paste the server private key. AxoConsole will automatically deploy the server private key to the related AxoRouters.
      • To provide the server private key from a file, select File path and enter the path where the private key file is located (for example, /etc/axorouter/user-config/server-private-key.pem). The path must be mounted into the container, /etc/axorouter is mounted by default. You must manually copy that file to its place on every affected AxoRouter, or you can use the configuration management system of your choice.
  6. (Optional) Select More options to change the advanced options of the connector.

  7. Select Add.

    Axoflow automatically creates connectors on the AxoRouter hosts that match the Router selector.

    Make sure to enable the ports you’ve configured in the connector on the firewall of the AxoRouter host, and on other firewalls between the AxoRouter host and your data sources.

  8. Configure your clients to send data to the connector. For details, see Configure the clients .

  9. Check that the data arrives: use Log tapping on the AxoRouter host to see the incoming messages.

Configure the clients

You can find the IP address or FQDN of the AxoRouter host on its Overview tab. In the following examples, replace 5044 with the Port of the connector if you’ve changed it.

Filebeat, Winlogbeat, and other Beats

Configure the Logstash output of the Beat with the address of the AxoRouter host and the port of the connector. For example, in filebeat.yml:

output.logstash:
  hosts: ["<router-IP-address>:5044"]

If you’ve enabled TLS on the connector, enable TLS in the output as well, and set the CA certificate that signed the certificate of the connector:

output.logstash:
  hosts: ["<router-IP-address>:5044"]
  ssl.enabled: true
  ssl.certificate_authorities: ["/etc/filebeat/router-ca.pem"]

Beats support only one output at a time. Comment out the output.elasticsearch section of the configuration file.

Logstash

Use the lumberjack output plugin with the address and the port of the connector. This plugin always uses TLS, so enable TLS on the connector. Set ssl_certificate to the certificate of the connector, or to the CA certificate that signed it. For example:

output {
  lumberjack {
    hosts => ["<router-IP-address>"]
    port => 5044
    ssl_certificate => "/etc/logstash/router-ca.pem"
  }
}

Advanced options

Select More options on the connector rule to set the following options.

The connector drops events that are larger than 10 MiB, and acknowledges them to the client so that the client doesn’t send them again. The lumberjack_frames_dropped_total metric counts the dropped events.

  • Maximum connections: The maximum number of connections that the connector accepts at the same time. Default value: 10. Every Beats instance keeps at least one connection open (more if you set its worker option to more than 1). If more than 10 connections can be open at the same time, increase this value.
  • Lumberjack window limit: The maximum number of events that the connector accepts in one Lumberjack window (batch). Set it to at least the bulk_max_size of your Beats. Default value: 10000.
  • Keepalive interval: How often the connector sends a keepalive to the client while it processes a window, so the client doesn’t time out. Default value: 5 seconds.
  • Lumberjack window timeout: How long the connector waits for the rest of a partially received window before it closes the connection. Default value: 30 seconds.
  • Maximum decompressed size: The maximum size of one compressed Lumberjack window after decompression. Default value: 64 MiB. The minimum value is 10485770 bytes (10 MiB and 10 bytes), the size one event of the maximum size needs. If a window is larger than this value after decompression, the connector closes the connection, and the client sends the window again. Set this option based on the batch size of your Beats, not on the size of a single event.

You can also adjust the flow-control related options.

  • Log window size: The size (number of messages) of the initial window used in flow control. For details, see the AxoSyslog documentation .

    If you change the value of Log window size, the change will affect only new connections, the Log window size of already established connections will not change. To apply the new Log window size value to every connection, restart the axorouter.service service on the Services page of the matching AxoRouters. A simple configuration reload is NOT sufficient.

    If the connector rule is receiving data using the UDP protocol, always restart the axorouter.service service on the Services page of the matching AxoRouters.

  • Log fetch limit: The maximum number of messages fetched from a source during a single poll loop. For details, see the AxoSyslog documentation .

Metadata fields

AxoRouter turns every event of a Lumberjack window into a separate message, and adds the following fields to the meta variable:

Analytics label Message field Value
connector.type meta.connector.type lumberjack
connector.name meta.connector.name The Name of the connector
connector.port meta.connector.port The port number where the connector receives data
connector.labels.product meta.connector.labels.product Default value: beats
connector.labels.vendor meta.connector.labels.vendor Default value: elastic
envelope.lumberjack.version meta.envelope.lumberjack.version The version of the Lumberjack protocol that the client used, 1 or 2

You can use the labels as:

You can use the message fields

  • in Flow Processing steps , for example, in the Query field of Select Messages steps,
  • in AQL expressions in the search bars.

Fields set from the Beats document

Beats send every event as a JSON document. Depending on the content of the document, AxoRouter sets the following fields as well:

  • If the document has an @timestamp field, AxoRouter uses its value as log.time_unix_nano , the timestamp of the message. Both the ISO 8601 format and epoch milliseconds are accepted.

  • If the document has an agent.type field (Beats set it on every document), AxoRouter also reads the following fields:

    • host.name becomes meta.host_candidate.name , the name that Axoflow uses to identify the host that sent the document. If the document has no host.name, AxoRouter uses the name or the IP address of the client.
    • event.dataset, or agent.type if the document has no dataset, becomes meta.service.name .
    • If the document has a message field, its value becomes log.body, and the rest of the document becomes log.attributes. meta.envelope.format is json.
  • Other JSON documents (for example, documents without a message field) become the log.body field as a JSON object. meta.envelope.format is raw, and meta.payload.format is json.

  • If an event isn’t valid JSON, it’s added to the log.body field as a string. You can add further parsing to the body using processing steps in Flows , for example, using FilterX or Regex processing steps .

Classification

If you turn on the Classify preprocessing step of the connector rule (or add a Classify step to the flow), AxoRouter can recognize the source of the documents. For example, it classifies the Windows events that Winlogbeat sends as microsoft/windows. For details, see Windows hosts.