logstash_formatter
JSON formatter meant for logstash
What it is and what it does
logstash_formatter is a Python logging formatter that converts standard log records into JSON objects matching Logstash's expected input format. It provides two formatter classes—LogstashFormatter and LogstashFormatterV1—that output logs with structured fields like @timestamp, @version, and custom extra fields, making it easy to pipe Python application logs directly into Logstash for centralized log aggregation.
The package has no runtime dependencies and integrates directly with Python's built-in logging module. You attach it as a formatter to any logging handler, and it automatically converts log messages to JSON with ISO 8601 timestamps, source host information, exception tracebacks when requested, and any custom fields you provide via the extra parameter or by passing dictionaries as messages.
Use it for:
- Centralize Python application logs in Logstash by formatting output as JSON that Logstash can ingest directly.
- Add structured metadata (account IDs, request IPs, custom fields) to logs for easier filtering and analysis in log aggregation systems.
- Capture exception tracebacks in JSON format when logging errors with exc_info=True for complete error context in log storage.
- Replace plain-text logging with JSON output to enable downstream log parsing, indexing, and alerting in ELK or similar stacks.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Formats Python logging output as JSON objects compatible with Logstash, allowing standard logs to be shipped as structured data.
No. The package is abandoned (last update 2018, last commit 2019) with no maintenance signal. While it has no known vulnerabilities and carries a permissive MIT license, the high install friction combined with lack of updates means compatibility with modern Python versions is uncertain. If you need JSON logging for Logstash, consider actively maintained alternatives.
Install
logstash-formatter on PyPI
pip
pip install logstash-formatteruv
uv add logstash-formatterpoetry
poetry add logstash-formatterInstalling logstash_formatter
Before you install
High install friction and abandoned maintenance status since 2019 with no recent updates. Last commit was 2019-08-12 and latest release 2018-02-13. No runtime dependencies, but the lack of active maintenance means compatibility with modern Python versions is uncertain.
License in practice
MIT license (permissive) means you can use, modify, and distribute this package freely with minimal restrictions, though you should retain the license notice.
Quickstart
pip install logstash_formatter
import logging
from logstash_formatter import LogstashFormatterV1
logger = logging.getLogger()
handler = logging.StreamHandler()
formatter = LogstashFormatterV1()
handler.setFormatter(formatter)
logger.addHandler(handler)
logger.info("test message")
No explicit Python version requirement stated; compatibility with modern Python versions is unverified given the package's abandoned status since 2019.
Verify before relying
- Whether LogstashFormatterV1 works correctly with current Python 3.x versions given no updates since 2018.
- Whether the Logstash schema version (1.2.0) is still compatible with current Logstash deployments.
- Whether there are known issues or breaking changes in Python versions released after the last update.
Package facts
| License | MIT, see LICENSE file (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | abandoned — 3,104 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 102,934/month — #12,835 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: logstash_formatter-0.5.17.tar.gz
Tags
More Monitoring packages
Wraps any iterable to display a real-time…
copyleft · top 100 on PyPI
opentelemetry-semantic-conventionsProvides generated Python code for…
permissive · top 100 on PyPI
opentelemetry-sdkProvides the reference implementation of the…
permissive · top 100 on PyPI
opentelemetry-apiProvides the abstract API and interfaces for…
permissive · top 100 on PyPI
opentelemetry-exporter-otlp-proto-httpExports OpenTelemetry observability data to an…
permissive · top 1,000 on PyPI
opentelemetry-instrumentationProvides automatic instrumentation commands and…
permissive · top 1,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
logzerologzero provides pre-configured Python logging…
permissive · top 5,000 on PyPI
logging-jsonFormats Python logging records as JSON output,…
permissive · top 15,000 on PyPI
python-logstashSends Python log records to Logstash over UDP…
permissive · top 15,000 on PyPI
json-loggingConfigures Python's standard logging module to…
permissive · top 5,000 on PyPI
pylogbeatPyLogBeat sends log messages and structured…
permissive · top 5,000 on PyPI
logfmterFormats Python stdlib logging output as logfmt…
permissive · top 15,000 on PyPI
python3-logstashA Python logging handler that forwards log…
permissive · top 15,000 on PyPI
mo-logsProvides structured JSON logging with…
copyleft · top 15,000 on PyPI