python-logstash
Python logging handler for Logstash.
What it is and what it does
python-logstash is a Python logging handler that bridges your application's logs to Logstash by formatting log records as JSON and sending them over UDP or TCP. It integrates directly with Python's standard logging module, allowing you to attach it to any logger and forward events to a Logstash instance for centralized aggregation, parsing, and analysis. The handler supports custom fields via the logging `extra` parameter, multiple transport protocols (UDP, TCP, AMQP), and can be configured in Django settings for framework-level integration.
The package has been dormant since March 2022, with no active maintenance or recent releases. While the repository remains archived-free and the code is stable for basic use cases, it has not been updated to address modern Python versions or Logstash schema changes that may have occurred in the past four years. Installation requires building from source, which adds friction compared to pre-built wheels.
Use it for:
- Forward application logs from a Python service to a centralized Logstash instance for aggregation and analysis.
- Integrate Django application logging with Logstash by configuring the handler in Django's LOGGING settings.
- Send structured log events with custom fields (strings, booleans, dicts, lists) to Logstash for enriched log analysis.
- Route logs through AMQP to Logstash when direct UDP/TCP is not available or when message queuing is required.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Sends Python log records to Logstash over UDP or TCP, formatting them as JSON events compatible with Logstash's input pipeline.
Yes, with conditions. The package is stable and permissively licensed, with no known vulnerabilities and a straightforward integration path. However, dormant maintenance since 2022 and source-only distribution create friction. Install only if you are already committed to Logstash and can tolerate the lack of active support; do not rely on it for new projects where you need ongoing compatibility updates or modern Python version guarantees.
Install
python-logstash on PyPI
pip
pip install python-logstashuv
uv add python-logstashpoetry
poetry add python-logstashInstalling python-logstash
Before you install
High install friction due to source-only distribution. Maintenance is dormant: last release was 2022-03-30, over 1598 days ago, though the repository remains active with 462 stars and a final commit on 2024-08-02. No runtime dependencies to manage.
License in practice
MIT license is permissive and poses no restrictions on use, modification, or redistribution in proprietary or open-source projects.
Quickstart
pip install python-logstash
import logging
import logstash
test_logger = logging.getLogger('test')
test_logger.setLevel(logging.INFO)
test_logger.addHandler(logstash.LogstashHandler('localhost', 5959, version=1))
test_logger.info('Test message')
Requires a running Logstash instance listening on the specified host and port; AMQP handler requires pika to be installed separately.
Verify before relying
- Whether Python 3.8+ compatibility has been validated since the last release in 2022.
- Current status of AMQP handler reliability and whether pika dependency is actively maintained.
- Whether the package works with modern Logstash versions beyond those tested during active development.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | dormant — 1,598 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 629,287/month — #5,666 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: python-logstash-0.4.8.tar.gz
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
pylogbeatPyLogBeat sends log messages and structured…
permissive · top 5,000 on PyPI
python3-logstashA Python logging handler that forwards log…
permissive · top 15,000 on PyPI
python-logstash-asyncAsynchronous Python logging handler that…
permissive · top 5,000 on PyPI
graypyProvides Python logging handlers that format…
permissive · top 15,000 on PyPI
logstash_formatterFormats Python logging output as JSON objects…
permissive · top 15,000 on PyPI
fluent-loggerSends structured event logs from Python…
unclear · top 5,000 on PyPI
pygelfProvides Python logging handlers that send log…
permissive · top 15,000 on PyPI
JSON-log-formatterFormats Python logging records as JSON,…
permissive · top 5,000 on PyPI
jsonformatterFormats Python logging output as JSON, enabling…
permissive · top 15,000 on PyPI
cloudwatchA Python logging handler that sends log events…
permissive · top 15,000 on PyPI