skillfed

logstash_formatter

JSON formatter meant for logstash

logstash-formatter v0.5.17 102.9K downloads/30d#12,835 on PyPI158
Permissive license MIT, see LICENSE file Abandoned released

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

uv

uv add logstash-formatter

poetry

poetry add logstash-formatter

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishProgramming Language :: PythonProgramming Language :: Python :: 3

Tags

json logging formatterlogstash json outputstructured logging pythonlog to logstashjson log formatterpython logging jsonlogstash compatible logs
loggingjson-outputabandoned

More Monitoring packages

tqdm

Wraps any iterable to display a real-time…

copyleft · top 100 on PyPI

opentelemetry-semantic-conventions

Provides generated Python code for…

permissive · top 100 on PyPI

opentelemetry-sdk

Provides the reference implementation of the…

permissive · top 100 on PyPI

opentelemetry-api

Provides the abstract API and interfaces for…

permissive · top 100 on PyPI

opentelemetry-exporter-otlp-proto-http

Exports OpenTelemetry observability data to an…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation

Provides automatic instrumentation commands and…

permissive · top 1,000 on PyPI

JSON-log-formatter

Formats Python logging records as JSON,…

permissive · top 5,000 on PyPI

jsonformatter

Formats Python logging output as JSON, enabling…

permissive · top 15,000 on PyPI

logzero

logzero provides pre-configured Python logging…

permissive · top 5,000 on PyPI

logging-json

Formats Python logging records as JSON output,…

permissive · top 15,000 on PyPI

python-logstash

Sends Python log records to Logstash over UDP…

permissive · top 15,000 on PyPI

json-logging

Configures Python's standard logging module to…

permissive · top 5,000 on PyPI

pylogbeat

PyLogBeat sends log messages and structured…

permissive · top 5,000 on PyPI

logfmter

Formats Python stdlib logging output as logfmt…

permissive · top 15,000 on PyPI

python3-logstash

A Python logging handler that forwards log…

permissive · top 15,000 on PyPI

mo-logs

Provides structured JSON logging with…

copyleft · top 15,000 on PyPI