skillfed

python-logstash

Python logging handler for Logstash.

python-logstash v0.4.8 629.3K downloads/30d#5,666 on PyPI462
Permissive license MIT DORMANT released

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-logstash

uv

uv add python-logstash

poetry

poetry add python-logstash

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 3Topic :: Internet :: WWW/HTTPTopic :: Software Development :: Libraries :: Python ModulesTopic :: System :: Logging

Tags

logstash logging handlersend logs to logstashpython logstash integrationlogstash json formattercentralized log aggregationudp tcp logging handler
log-aggregationlogstash-integration

More Python Modules packages