PyLogBeat is a simple, incomplete implementation of the Beats protocol used by Elastic Beats and Logstash. It enables reliable data transfer by having the server acknowledge received data, allowing the client to know whether and what to resend. The library is actively maintained, with a recent major release (2.1.0) in late 2025, and continues to support modern Python environments.
pip install pylogbeatVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to send a single log message to a Logstash or Beats input plugin using `PyLogBeatClient`. It utilizes a context manager for automatic connection and disconnection, and shows a basic message structure. Remember to set `LOGSTASH_HOST` and `LOGSTASH_PORT` environment variables or update the default values.
Upgrade Python to 3.11 or newer, or pin `pylogbeat` to a version compatible with your Python environment (e.g., `<2.0.0` for Python 2.x, `<2.1.0` for Python 3.6-3.10).
Ensure your project is running on Python 3 and that any dependencies on `six` are handled elsewhere if necessary. If still on Python 2, use `pylogbeat < 2.0.0`.
Ensure your Logstash instance is version `5.6.12` or higher, or `6.4.0` or higher.
Set `use_logging=False` if `pylogbeat` is acting as a transport for a logging handler to prevent infinite logging loops or issues during logging subsystem shutdown.
Be aware that not all advanced or edge-case features of the Beats protocol might be fully supported. Test thoroughly if your use case relies on complex Beats protocol behaviors.
Install the library using pip: `pip install pylogbeat`
Ensure the Beats protocol listener (e.g., Logstash Beats input plugin) is running and accessible on the specified host and port, and check any firewall rules on both client and server machines.
Increase the `timeout` value in the `PyLogBeatClient` constructor, verify network connectivity, and check the health and responsiveness of the Logstash or Beats server.
Upgrade your Python environment to version 3.11 or newer, or downgrade 'pylogbeat' to a compatible version (e.g., `pip install pylogbeat<2.1.0` for Python 3.6-3.10).
Wrap the single message dictionary in a list when calling `client.send()`: `client.send([message_dict])`
No dependency data recorded yet.